Initializes a new instance of the SwitchbotDevice class.
The peripheral object from noble.
The Noble object.
Sends a command to the device and awaits a response.
The command buffer.
A Promise that resolves with the response buffer.
Connects to the device.
A Promise that resolves when the connection is complete.
Disconnects from the device.
A Promise that resolves when the disconnection is complete.
Discovers the device services.
A Promise that resolves with the list of services.
Retrieves the device characteristics.
A Promise that resolves with the device characteristics.
Retrieves the device name.
A Promise that resolves with the device name.
Internal method to handle the connection process.
A Promise that resolves when the connection is complete.
Logs a message with the specified log level.
The severity level of the log (e.g., 'info', 'warn', 'error').
The log message to be emitted.
Operates the air purifier with the given byte array.
The byte array to send.
Sets the device name.
The new device name.
A Promise that resolves when the name is set.
Sets the mode of the air purifier.
The mode value (1-4).
Sets the speed of the air purifier.
The speed value (0-100).
Turns the air purifier off.
Turns the air purifier on.
Unsubscribes from the notify characteristic.
A Promise that resolves when the unsubscription is complete.
Static
parseParses service data for air purifier devices.
The service data buffer.
The manufacturer data buffer.
Optional
emitLog: (level: string, message: string) => voidThe function to emit log messages.
Class representing a SwitchBot Air Purifier device.