tinkerforge_async/bindings/
humidity_bricklet.rs

1/* ***********************************************************
2 * This file was automatically generated on 2024-02-16.      *
3 *                                                           *
4 * Rust Bindings Version 2.0.20                              *
5 *                                                           *
6 * If you have a bugfix for this file and want to commit it, *
7 * please fix the bug in the generator. You can find a link  *
8 * to the generators git repository on tinkerforge.com       *
9 *************************************************************/
10
11//! Measures relative humidity.
12//!
13//! See also the documentation [here](https://www.tinkerforge.com/en/doc/Software/Bricklets/Humidity_Bricklet_Rust.html).
14#[allow(unused_imports)]
15use crate::{
16    base58::Uid, byte_converter::*, device::*, error::TinkerforgeError, ip_connection::async_io::AsyncIpConnection,
17    low_level_traits::LowLevelRead,
18};
19#[allow(unused_imports)]
20use futures_core::Stream;
21#[allow(unused_imports)]
22use tokio_stream::StreamExt;
23pub enum HumidityBrickletFunction {
24    GetHumidity,
25    GetAnalogValue,
26    SetHumidityCallbackPeriod,
27    GetHumidityCallbackPeriod,
28    SetAnalogValueCallbackPeriod,
29    GetAnalogValueCallbackPeriod,
30    SetHumidityCallbackThreshold,
31    GetHumidityCallbackThreshold,
32    SetAnalogValueCallbackThreshold,
33    GetAnalogValueCallbackThreshold,
34    SetDebouncePeriod,
35    GetDebouncePeriod,
36    GetIdentity,
37    CallbackHumidity,
38    CallbackAnalogValue,
39    CallbackHumidityReached,
40    CallbackAnalogValueReached,
41}
42impl From<HumidityBrickletFunction> for u8 {
43    fn from(fun: HumidityBrickletFunction) -> Self {
44        match fun {
45            HumidityBrickletFunction::GetHumidity => 1,
46            HumidityBrickletFunction::GetAnalogValue => 2,
47            HumidityBrickletFunction::SetHumidityCallbackPeriod => 3,
48            HumidityBrickletFunction::GetHumidityCallbackPeriod => 4,
49            HumidityBrickletFunction::SetAnalogValueCallbackPeriod => 5,
50            HumidityBrickletFunction::GetAnalogValueCallbackPeriod => 6,
51            HumidityBrickletFunction::SetHumidityCallbackThreshold => 7,
52            HumidityBrickletFunction::GetHumidityCallbackThreshold => 8,
53            HumidityBrickletFunction::SetAnalogValueCallbackThreshold => 9,
54            HumidityBrickletFunction::GetAnalogValueCallbackThreshold => 10,
55            HumidityBrickletFunction::SetDebouncePeriod => 11,
56            HumidityBrickletFunction::GetDebouncePeriod => 12,
57            HumidityBrickletFunction::GetIdentity => 255,
58            HumidityBrickletFunction::CallbackHumidity => 13,
59            HumidityBrickletFunction::CallbackAnalogValue => 14,
60            HumidityBrickletFunction::CallbackHumidityReached => 15,
61            HumidityBrickletFunction::CallbackAnalogValueReached => 16,
62        }
63    }
64}
65pub const HUMIDITY_BRICKLET_THRESHOLD_OPTION_OFF: char = 'x';
66pub const HUMIDITY_BRICKLET_THRESHOLD_OPTION_OUTSIDE: char = 'o';
67pub const HUMIDITY_BRICKLET_THRESHOLD_OPTION_INSIDE: char = 'i';
68pub const HUMIDITY_BRICKLET_THRESHOLD_OPTION_SMALLER: char = '<';
69pub const HUMIDITY_BRICKLET_THRESHOLD_OPTION_GREATER: char = '>';
70
71#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
72pub struct HumidityCallbackThreshold {
73    pub option: char,
74    pub min: u16,
75    pub max: u16,
76}
77impl FromByteSlice for HumidityCallbackThreshold {
78    fn bytes_expected() -> usize {
79        5
80    }
81    fn from_le_byte_slice(bytes: &[u8]) -> HumidityCallbackThreshold {
82        HumidityCallbackThreshold {
83            option: <char>::from_le_byte_slice(&bytes[0..1]),
84            min: <u16>::from_le_byte_slice(&bytes[1..3]),
85            max: <u16>::from_le_byte_slice(&bytes[3..5]),
86        }
87    }
88}
89
90#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
91pub struct AnalogValueCallbackThreshold {
92    pub option: char,
93    pub min: u16,
94    pub max: u16,
95}
96impl FromByteSlice for AnalogValueCallbackThreshold {
97    fn bytes_expected() -> usize {
98        5
99    }
100    fn from_le_byte_slice(bytes: &[u8]) -> AnalogValueCallbackThreshold {
101        AnalogValueCallbackThreshold {
102            option: <char>::from_le_byte_slice(&bytes[0..1]),
103            min: <u16>::from_le_byte_slice(&bytes[1..3]),
104            max: <u16>::from_le_byte_slice(&bytes[3..5]),
105        }
106    }
107}
108
109#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
110pub struct Identity {
111    pub uid: String,
112    pub connected_uid: String,
113    pub position: char,
114    pub hardware_version: [u8; 3],
115    pub firmware_version: [u8; 3],
116    pub device_identifier: u16,
117}
118impl FromByteSlice for Identity {
119    fn bytes_expected() -> usize {
120        25
121    }
122    fn from_le_byte_slice(bytes: &[u8]) -> Identity {
123        Identity {
124            uid: <String>::from_le_byte_slice(&bytes[0..8]),
125            connected_uid: <String>::from_le_byte_slice(&bytes[8..16]),
126            position: <char>::from_le_byte_slice(&bytes[16..17]),
127            hardware_version: <[u8; 3]>::from_le_byte_slice(&bytes[17..20]),
128            firmware_version: <[u8; 3]>::from_le_byte_slice(&bytes[20..23]),
129            device_identifier: <u16>::from_le_byte_slice(&bytes[23..25]),
130        }
131    }
132}
133
134/// Measures relative humidity
135#[derive(Clone)]
136pub struct HumidityBricklet {
137    device: Device,
138}
139impl HumidityBricklet {
140    pub const DEVICE_IDENTIFIER: u16 = 27;
141    pub const DEVICE_DISPLAY_NAME: &'static str = "Humidity Bricklet";
142    /// Creates an object with the unique device ID `uid`. This object can then be used after the IP Connection `ip_connection` is connected.
143    pub fn new(uid: Uid, connection: AsyncIpConnection) -> HumidityBricklet {
144        let mut result = HumidityBricklet { device: Device::new([2, 0, 10], uid, connection, Self::DEVICE_DISPLAY_NAME) };
145        result.device.response_expected[u8::from(HumidityBrickletFunction::GetHumidity) as usize] = ResponseExpectedFlag::AlwaysTrue;
146        result.device.response_expected[u8::from(HumidityBrickletFunction::GetAnalogValue) as usize] = ResponseExpectedFlag::AlwaysTrue;
147        result.device.response_expected[u8::from(HumidityBrickletFunction::SetHumidityCallbackPeriod) as usize] =
148            ResponseExpectedFlag::True;
149        result.device.response_expected[u8::from(HumidityBrickletFunction::GetHumidityCallbackPeriod) as usize] =
150            ResponseExpectedFlag::AlwaysTrue;
151        result.device.response_expected[u8::from(HumidityBrickletFunction::SetAnalogValueCallbackPeriod) as usize] =
152            ResponseExpectedFlag::True;
153        result.device.response_expected[u8::from(HumidityBrickletFunction::GetAnalogValueCallbackPeriod) as usize] =
154            ResponseExpectedFlag::AlwaysTrue;
155        result.device.response_expected[u8::from(HumidityBrickletFunction::SetHumidityCallbackThreshold) as usize] =
156            ResponseExpectedFlag::True;
157        result.device.response_expected[u8::from(HumidityBrickletFunction::GetHumidityCallbackThreshold) as usize] =
158            ResponseExpectedFlag::AlwaysTrue;
159        result.device.response_expected[u8::from(HumidityBrickletFunction::SetAnalogValueCallbackThreshold) as usize] =
160            ResponseExpectedFlag::True;
161        result.device.response_expected[u8::from(HumidityBrickletFunction::GetAnalogValueCallbackThreshold) as usize] =
162            ResponseExpectedFlag::AlwaysTrue;
163        result.device.response_expected[u8::from(HumidityBrickletFunction::SetDebouncePeriod) as usize] = ResponseExpectedFlag::True;
164        result.device.response_expected[u8::from(HumidityBrickletFunction::GetDebouncePeriod) as usize] = ResponseExpectedFlag::AlwaysTrue;
165        result.device.response_expected[u8::from(HumidityBrickletFunction::GetIdentity) as usize] = ResponseExpectedFlag::AlwaysTrue;
166        result
167    }
168
169    /// Returns the response expected flag for the function specified by the function ID parameter.
170    /// It is true if the function is expected to send a response, false otherwise.
171    ///
172    /// For getter functions this is enabled by default and cannot be disabled, because those
173    /// functions will always send a response. For callback configuration functions it is enabled
174    /// by default too, but can be disabled by [`set_response_expected`](crate::humidity_bricklet::HumidityBricklet::set_response_expected).
175    /// For setter functions it is disabled by default and can be enabled.
176    ///
177    /// Enabling the response expected flag for a setter function allows to detect timeouts
178    /// and other error conditions calls of this setter as well. The device will then send a response
179    /// for this purpose. If this flag is disabled for a setter function then no response is sent
180    /// and errors are silently ignored, because they cannot be detected.
181    ///
182    /// See [`set_response_expected`](crate::humidity_bricklet::HumidityBricklet::set_response_expected) for the list of function ID constants available for this function.
183    pub fn get_response_expected(&mut self, fun: HumidityBrickletFunction) -> Result<bool, GetResponseExpectedError> {
184        self.device.get_response_expected(u8::from(fun))
185    }
186
187    /// Changes the response expected flag of the function specified by the function ID parameter.
188    /// This flag can only be changed for setter (default value: false) and callback configuration
189    /// functions (default value: true). For getter functions it is always enabled.
190    ///
191    /// Enabling the response expected flag for a setter function allows to detect timeouts and
192    /// other error conditions calls of this setter as well. The device will then send a response
193    /// for this purpose. If this flag is disabled for a setter function then no response is sent
194    /// and errors are silently ignored, because they cannot be detected.
195    pub fn set_response_expected(
196        &mut self,
197        fun: HumidityBrickletFunction,
198        response_expected: bool,
199    ) -> Result<(), SetResponseExpectedError> {
200        self.device.set_response_expected(u8::from(fun), response_expected)
201    }
202
203    /// Changes the response expected flag for all setter and callback configuration functions of this device at once.
204    pub fn set_response_expected_all(&mut self, response_expected: bool) {
205        self.device.set_response_expected_all(response_expected)
206    }
207
208    /// Returns the version of the API definition (major, minor, revision) implemented by this API bindings.
209    /// This is neither the release version of this API bindings nor does it tell you anything about the represented Brick or Bricklet.
210    pub fn get_api_version(&self) -> [u8; 3] {
211        self.device.api_version
212    }
213
214    /// This receiver is triggered periodically with the period that is set by
215    /// [`set_humidity_callback_period`]. The parameter is the humidity of
216    /// the sensor.
217    ///
218    /// The [`get_humidity_callback_receiver`] receiver is only triggered if the humidity has changed since
219    /// the last triggering.
220    ///
221    /// [`set_humidity_callback_period`]: #method.set_humidity_callback_period
222    /// [`get_humidity_callback_receiver`]: #method.get_humidity_callback_receiver
223    pub async fn get_humidity_callback_receiver(&mut self) -> impl Stream<Item = u16> {
224        self.device
225            .get_callback_receiver(u8::from(HumidityBrickletFunction::CallbackHumidity))
226            .await
227            .map(|p| u16::from_le_byte_slice(p.body()))
228    }
229
230    /// This receiver is triggered periodically with the period that is set by
231    /// [`set_analog_value_callback_period`]. The parameter is the analog
232    /// value of the sensor.
233    ///
234    /// The [`get_analog_value_callback_receiver`] receiver is only triggered if the humidity has changed
235    /// since the last triggering.
236    pub async fn get_analog_value_callback_receiver(&mut self) -> impl Stream<Item = u16> {
237        self.device
238            .get_callback_receiver(u8::from(HumidityBrickletFunction::CallbackAnalogValue))
239            .await
240            .map(|p| u16::from_le_byte_slice(p.body()))
241    }
242
243    /// This receiver is triggered when the threshold as set by
244    /// [`set_humidity_callback_threshold`] is reached.
245    /// The parameter is the humidity of the sensor.
246    ///
247    /// If the threshold keeps being reached, the receiver is triggered periodically
248    /// with the period as set by [`set_debounce_period`].
249    pub async fn get_humidity_reached_callback_receiver(&mut self) -> impl Stream<Item = u16> {
250        self.device
251            .get_callback_receiver(u8::from(HumidityBrickletFunction::CallbackHumidityReached))
252            .await
253            .map(|p| u16::from_le_byte_slice(p.body()))
254    }
255
256    /// This receiver is triggered when the threshold as set by
257    /// [`set_analog_value_callback_threshold`] is reached.
258    /// The parameter is the analog value of the sensor.
259    ///
260    /// If the threshold keeps being reached, the receiver is triggered periodically
261    /// with the period as set by [`set_debounce_period`].
262    pub async fn get_analog_value_reached_callback_receiver(&mut self) -> impl Stream<Item = u16> {
263        self.device
264            .get_callback_receiver(u8::from(HumidityBrickletFunction::CallbackAnalogValueReached))
265            .await
266            .map(|p| u16::from_le_byte_slice(p.body()))
267    }
268
269    /// Returns the humidity of the sensor.
270    ///
271    /// If you want to get the humidity periodically, it is recommended to use the
272    /// [`get_humidity_callback_receiver`] receiver and set the period with
273    /// [`set_humidity_callback_period`].
274    pub async fn get_humidity(&mut self) -> Result<u16, TinkerforgeError> {
275        let payload = [0; 0];
276
277        #[allow(unused_variables)]
278        let result = self.device.get(u8::from(HumidityBrickletFunction::GetHumidity), &payload).await?;
279        Ok(u16::from_le_byte_slice(result.body()))
280    }
281
282    /// Returns the value as read by a 12-bit analog-to-digital converter.
283    ///
284    /// # Note
285    ///  The value returned by :func:[Get Humidity` is averaged over several samples
286    ///  to yield less noise, while [`get_analog_value`] gives back raw
287    ///  unfiltered analog values. The returned humidity value is calibrated for
288    ///  room temperatures, if you use the sensor in extreme cold or extreme
289    ///  warm environments, you might want to calculate the humidity from
290    ///  the analog value yourself. See the `HIH 5030 datasheet
291    /// ](https://github.com/Tinkerforge/humidity-bricklet/raw/master/datasheets/hih-5030.pdf)__.
292    ///
293    /// If you want the analog value periodically, it is recommended to use the
294    /// [`get_analog_value_callback_receiver`] receiver and set the period with
295    /// [`set_analog_value_callback_period`].
296    pub async fn get_analog_value(&mut self) -> Result<u16, TinkerforgeError> {
297        let payload = [0; 0];
298
299        #[allow(unused_variables)]
300        let result = self.device.get(u8::from(HumidityBrickletFunction::GetAnalogValue), &payload).await?;
301        Ok(u16::from_le_byte_slice(result.body()))
302    }
303
304    /// Sets the period with which the [`get_humidity_callback_receiver`] receiver is triggered
305    /// periodically. A value of 0 turns the receiver off.
306    ///
307    /// The [`get_humidity_callback_receiver`] receiver is only triggered if the humidity has changed
308    /// since the last triggering.
309    pub async fn set_humidity_callback_period(&mut self, period: u32) -> Result<(), TinkerforgeError> {
310        let mut payload = [0; 4];
311        period.write_to_slice(&mut payload[0..4]);
312
313        #[allow(unused_variables)]
314        let result = self.device.set(u8::from(HumidityBrickletFunction::SetHumidityCallbackPeriod), &payload).await?;
315        Ok(())
316    }
317
318    /// Returns the period as set by [`set_humidity_callback_period`].
319    pub async fn get_humidity_callback_period(&mut self) -> Result<u32, TinkerforgeError> {
320        let payload = [0; 0];
321
322        #[allow(unused_variables)]
323        let result = self.device.get(u8::from(HumidityBrickletFunction::GetHumidityCallbackPeriod), &payload).await?;
324        Ok(u32::from_le_byte_slice(result.body()))
325    }
326
327    /// Sets the period with which the [`get_analog_value_callback_receiver`] receiver is triggered
328    /// periodically. A value of 0 turns the receiver off.
329    ///
330    /// The [`get_analog_value_callback_receiver`] receiver is only triggered if the analog value has
331    /// changed since the last triggering.
332    pub async fn set_analog_value_callback_period(&mut self, period: u32) -> Result<(), TinkerforgeError> {
333        let mut payload = [0; 4];
334        period.write_to_slice(&mut payload[0..4]);
335
336        #[allow(unused_variables)]
337        let result = self.device.set(u8::from(HumidityBrickletFunction::SetAnalogValueCallbackPeriod), &payload).await?;
338        Ok(())
339    }
340
341    /// Returns the period as set by [`set_analog_value_callback_period`].
342    pub async fn get_analog_value_callback_period(&mut self) -> Result<u32, TinkerforgeError> {
343        let payload = [0; 0];
344
345        #[allow(unused_variables)]
346        let result = self.device.get(u8::from(HumidityBrickletFunction::GetAnalogValueCallbackPeriod), &payload).await?;
347        Ok(u32::from_le_byte_slice(result.body()))
348    }
349
350    /// Sets the thresholds for the [`get_humidity_reached_callback_receiver`] receiver.
351    ///
352    /// The following options are possible:
353    ///
354    ///  Option| Description
355    ///  --- | ---
356    ///  'x'|    Receiver is turned off
357    ///  'o'|    Receiver is triggered when the humidity is *outside* the min and max values
358    ///  'i'|    Receiver is triggered when the humidity is *inside* the min and max values
359    ///  '<'|    Receiver is triggered when the humidity is smaller than the min value (max is ignored)
360    ///  '>'|    Receiver is triggered when the humidity is greater than the min value (max is ignored)
361    ///
362    /// Associated constants:
363    /// * HUMIDITY_BRICKLET_THRESHOLD_OPTION_OFF
364    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_OUTSIDE
365    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_INSIDE
366    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_SMALLER
367    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_GREATER
368    pub async fn set_humidity_callback_threshold(&mut self, option: char, min: u16, max: u16) -> Result<(), TinkerforgeError> {
369        let mut payload = [0; 5];
370        option.write_to_slice(&mut payload[0..1]);
371        min.write_to_slice(&mut payload[1..3]);
372        max.write_to_slice(&mut payload[3..5]);
373
374        #[allow(unused_variables)]
375        let result = self.device.set(u8::from(HumidityBrickletFunction::SetHumidityCallbackThreshold), &payload).await?;
376        Ok(())
377    }
378
379    /// Returns the threshold as set by [`set_humidity_callback_threshold`].
380    ///
381    /// Associated constants:
382    /// * HUMIDITY_BRICKLET_THRESHOLD_OPTION_OFF
383    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_OUTSIDE
384    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_INSIDE
385    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_SMALLER
386    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_GREATER
387    pub async fn get_humidity_callback_threshold(&mut self) -> Result<HumidityCallbackThreshold, TinkerforgeError> {
388        let payload = [0; 0];
389
390        #[allow(unused_variables)]
391        let result = self.device.get(u8::from(HumidityBrickletFunction::GetHumidityCallbackThreshold), &payload).await?;
392        Ok(HumidityCallbackThreshold::from_le_byte_slice(result.body()))
393    }
394
395    /// Sets the thresholds for the [`get_analog_value_reached_callback_receiver`] receiver.
396    ///
397    /// The following options are possible:
398    ///
399    ///  Option| Description
400    ///  --- | ---
401    ///  'x'|    Receiver is turned off
402    ///  'o'|    Receiver is triggered when the analog value is *outside* the min and max values
403    ///  'i'|    Receiver is triggered when the analog value is *inside* the min and max values
404    ///  '<'|    Receiver is triggered when the analog value is smaller than the min value (max is ignored)
405    ///  '>'|    Receiver is triggered when the analog value is greater than the min value (max is ignored)
406    ///
407    /// Associated constants:
408    /// * HUMIDITY_BRICKLET_THRESHOLD_OPTION_OFF
409    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_OUTSIDE
410    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_INSIDE
411    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_SMALLER
412    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_GREATER
413    pub async fn set_analog_value_callback_threshold(&mut self, option: char, min: u16, max: u16) -> Result<(), TinkerforgeError> {
414        let mut payload = [0; 5];
415        option.write_to_slice(&mut payload[0..1]);
416        min.write_to_slice(&mut payload[1..3]);
417        max.write_to_slice(&mut payload[3..5]);
418
419        #[allow(unused_variables)]
420        let result = self.device.set(u8::from(HumidityBrickletFunction::SetAnalogValueCallbackThreshold), &payload).await?;
421        Ok(())
422    }
423
424    /// Returns the threshold as set by [`set_analog_value_callback_threshold`].
425    ///
426    /// Associated constants:
427    /// * HUMIDITY_BRICKLET_THRESHOLD_OPTION_OFF
428    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_OUTSIDE
429    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_INSIDE
430    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_SMALLER
431    ///	* HUMIDITY_BRICKLET_THRESHOLD_OPTION_GREATER
432    pub async fn get_analog_value_callback_threshold(&mut self) -> Result<AnalogValueCallbackThreshold, TinkerforgeError> {
433        let payload = [0; 0];
434
435        #[allow(unused_variables)]
436        let result = self.device.get(u8::from(HumidityBrickletFunction::GetAnalogValueCallbackThreshold), &payload).await?;
437        Ok(AnalogValueCallbackThreshold::from_le_byte_slice(result.body()))
438    }
439
440    /// Sets the period with which the threshold receivers
441    ///
442    /// * [`get_humidity_reached_callback_receiver`],
443    /// * [`get_analog_value_reached_callback_receiver`]
444    ///
445    /// are triggered, if the thresholds
446    ///
447    /// * [`set_humidity_callback_threshold`],
448    /// * [`set_analog_value_callback_threshold`]
449    ///
450    /// keep being reached.
451    pub async fn set_debounce_period(&mut self, debounce: u32) -> Result<(), TinkerforgeError> {
452        let mut payload = [0; 4];
453        debounce.write_to_slice(&mut payload[0..4]);
454
455        #[allow(unused_variables)]
456        let result = self.device.set(u8::from(HumidityBrickletFunction::SetDebouncePeriod), &payload).await?;
457        Ok(())
458    }
459
460    /// Returns the debounce period as set by [`set_debounce_period`].
461    pub async fn get_debounce_period(&mut self) -> Result<u32, TinkerforgeError> {
462        let payload = [0; 0];
463
464        #[allow(unused_variables)]
465        let result = self.device.get(u8::from(HumidityBrickletFunction::GetDebouncePeriod), &payload).await?;
466        Ok(u32::from_le_byte_slice(result.body()))
467    }
468
469    /// Returns the UID, the UID where the Bricklet is connected to,
470    /// the position, the hardware and firmware version as well as the
471    /// device identifier.
472    ///
473    /// The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
474    /// A Bricklet connected to an [Isolator Bricklet](isolator_bricklet) is always at
475    /// position 'z'.
476    ///
477    /// The device identifier numbers can be found [here](device_identifier).
478    /// |device_identifier_constant|
479    pub async fn get_identity(&mut self) -> Result<Identity, TinkerforgeError> {
480        let payload = [0; 0];
481
482        #[allow(unused_variables)]
483        let result = self.device.get(u8::from(HumidityBrickletFunction::GetIdentity), &payload).await?;
484        Ok(Identity::from_le_byte_slice(result.body()))
485    }
486}