getSensorStateFromDevice method
Retrieves the current state of the sensor.
Returns: A Stream of SensorConfigStateEntity that emits the current state of the sensor when data is available.
Note: This method should be used to get the most recent state of the sensor and may block until the data is received. Ensure to handle the stream properly to manage resources effectively.
Implementation
Stream<SensorConfigStateEntity> getSensorStateFromDevice({bool loop = false}) {
getSensorStateLoop = loop;
writeData(_buildGetNetStateJson());
return _sensorConfigStateStream.stream;
}