![]() ![]() Should not update only due to time passing. Requires native_value to be a Python datetime.date object, or None. Constantīit/s, kbit/s, Mbit/s, Gbit/s, B/s, kB/s, MB/s, GB/s, KiB/s, MiB/s, GiB/sīit, kbit, Mbit, Gbit, B, kB, MB, GB, TB, PB, EB, ZB, YB, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiBĭate. If specifying a device class, your sensor entity will need to also return the correct unit of measurement. If extra_state_attributes and the sensor value both frequently change, this can quickly increase the size of the database. Attributes that do not change are only saved in the database once. Instead of adding extra_state_attributes for a sensor entity, create an additional sensor entity. This property is intended to be used by integrations to override automatic unit conversion rules, for example, to make a temperature sensor always display in ☌ regardless of whether the configured unit system prefers ☌ or ☏, or to make a distance sensor always display in miles even if the configured unit system is metric. For sensors without a unique_id, this will be the unit of measurement for the sensor's state. For sensors with a unique_id, this will be used as the initial unit of measurement, which users can then override. The unit of measurement to be used for the sensor's state. The number of decimals which should be used in the sensor's state when it's displayed. If not None, the sensor is assumed to be numerical and will be displayed as a line-chart in the frontend instead of as discrete values. Cannot be combined with state_class or native_unit_of_measurement. Requires the enum device class to be set. In case this sensor provides a textual state, this property can be used to provide a list of possible states. Using a device_class may restrict the types that can be returned by this property. The value of the sensor in the sensor's native_unit_of_measurement. None, datetime.date, datetime.datetime, decimal.Decimal, float, int, string If the native_unit_of_measurement is ☌ or ☏, and its device_class is temperature, the sensor's unit_of_measurement will be the preferred temperature unit configured by the user and the sensor's state will be the native_value after an optional unit conversion. The unit of measurement that the sensor's value is expressed in. When changing last_reset, the state must be a valid number. Note that the datetime.datetime returned by the last_reset property will be converted to an ISO 8601-formatted string when the entity's state attributes are updated. If the time of initialization is unknown, set it to None. The time when an accumulating sensor such as an electricity usage meter, gas meter, water meter etc. Implement update() or async_update() to fetch data. Properties should always only return information from memory and not do I/O (like network requests). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |