mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 01:29:58 +00:00
Improve message names
This commit is contained in:
@@ -48,8 +48,8 @@ export default class Discovery {
|
||||
|
||||
constructor(opts: DiscoveryOptions) {
|
||||
/**
|
||||
* When a service is found, gather device info from service object and
|
||||
* TXT record, then send a `main:receiverDeviceUp` message.
|
||||
* When a service is found, gather device info from service
|
||||
* object and TXT record, then send a `main:deviceUp` message.
|
||||
*/
|
||||
this.browser.on("serviceUp", service => {
|
||||
// Filter invalid results
|
||||
@@ -69,7 +69,7 @@ export default class Discovery {
|
||||
});
|
||||
|
||||
/**
|
||||
* When a service is lost, send a `main:receiverDeviceDown` message with
|
||||
* When a service is lost, send a `main:deviceDown` message with
|
||||
* the service name as the `deviceId`.
|
||||
*/
|
||||
this.browser.on("serviceDown", service => {
|
||||
|
||||
@@ -39,7 +39,7 @@ messaging.on("message", (message: Message) => {
|
||||
discovery = new Discovery({
|
||||
onDeviceFound(device) {
|
||||
messaging.sendMessage({
|
||||
subject: "main:receiverDeviceUp",
|
||||
subject: "main:deviceUp",
|
||||
data: {
|
||||
deviceId: device.id,
|
||||
deviceInfo: device
|
||||
@@ -80,7 +80,7 @@ messaging.on("message", (message: Message) => {
|
||||
},
|
||||
onDeviceDown(deviceId) {
|
||||
messaging.sendMessage({
|
||||
subject: "main:receiverDeviceDown",
|
||||
subject: "main:deviceDown",
|
||||
data: { deviceId }
|
||||
});
|
||||
|
||||
|
||||
@@ -48,12 +48,12 @@ type MessageDefinitions = {
|
||||
* Sent to extension from the bridge whenever a receiver device is
|
||||
* found.
|
||||
*/
|
||||
"main:receiverDeviceUp": { deviceId: string; deviceInfo: ReceiverDevice };
|
||||
"main:deviceUp": { deviceId: string; deviceInfo: ReceiverDevice };
|
||||
/**
|
||||
* Sent to extension from the bridge whenever a previously found
|
||||
* receiver device is lost.
|
||||
*/
|
||||
"main:receiverDeviceDown": { deviceId: string };
|
||||
"main:deviceDown": { deviceId: string };
|
||||
|
||||
/**
|
||||
* Sent to the extension from the bridge whenever a
|
||||
|
||||
Reference in New Issue
Block a user