Skip to content

Commit

Permalink
switch to extra state attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
siku2 authored Dec 22, 2021
1 parent a4af1f7 commit 38039c8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.venv/
/venv/

__pycache__/
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.6] - 2021-12-22

### Changes

- Switched from deprecated device_state_attributes to extra_state_attributes.

## [0.1.5] - 2021-09-23

### Added
Expand All @@ -18,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fixed incompatibility with version 1.3 of the dingz API

[Unreleased]: https://github.com/siku2/hass-dingz/compare/v0.1.5...HEAD
[Unreleased]: https://github.com/siku2/hass-dingz/compare/v0.1.6...HEAD
[0.1.6]: https://github.com/siku2/hass-dingz/compare/v0.1.5...v0.1.6
[0.1.5]: https://github.com/siku2/hass-dingz/compare/v0.1.4...v0.1.5
[0.1.4]: https://github.com/siku2/hass-dingz/releases/tag/v0.1.4
4 changes: 2 additions & 2 deletions custom_components/dingz/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def supported_features(self):
return SUPPORT_BRIGHTNESS | SUPPORT_COLOR

@property
def device_state_attributes(self):
def extra_state_attributes(self):
coordinator = self.coordinator
state = self._dingz_state
return {
Expand Down Expand Up @@ -125,7 +125,7 @@ def supported_features(self):
return features

@property
def device_state_attributes(self):
def extra_state_attributes(self):
power_outputs = self._dingz_state.sensors.power_outputs
if power_outputs:
power_output = round(power_outputs[self._index], 1)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/dingz/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "dingz",
"name": "dingz",
"version": "0.1.5",
"version": "0.1.6",
"config_flow": true,
"dependencies": [],
"codeowners": [
Expand Down
6 changes: 3 additions & 3 deletions custom_components/dingz/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def state(self):
return self._dingz_state.sensors.brightness

@property
def device_state_attributes(self):
def extra_state_attributes(self):
sensors = self._dingz_state.sensors
return {"light_state": sensors.light_state}

Expand All @@ -67,7 +67,7 @@ def is_on(self):
return bool(self._dingz_state.sensors.person_present)

@property
def device_state_attributes(self):
def extra_state_attributes(self):
sensors = self._dingz_state.sensors
return {
"light_off_timer": sensors.light_off_timer,
Expand All @@ -93,7 +93,7 @@ def state(self):
return self._dingz_state.sensors.room_temperature

@property
def device_state_attributes(self):
def extra_state_attributes(self):
sensors = self._dingz_state.sensors
return {
"cpu": sensors.cpu_temperature,
Expand Down

0 comments on commit 38039c8

Please sign in to comment.