Use new enums in zwave tests#62711
Conversation
|
Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration ( |
| device = sensor.get_device(node=node, values=values, node_config={}) | ||
| assert isinstance(device, sensor.ZWaveBatterySensor) | ||
| assert device.device_class == homeassistant.const.DEVICE_CLASS_BATTERY | ||
| assert device.device_class == BinarySensorDeviceClass.BATTERY |
There was a problem hiding this comment.
This is not state attributes, so you should be able to use is here
There was a problem hiding this comment.
And are you sure that it should not be SensorDeviceClass here rather than BinarySensorDeviceClass
There was a problem hiding this comment.
I think you are right. Swapped to SensorDeviceClass.
And agreed, == to is.
Done.
| assert device.state == 191.0 | ||
| assert device.unit_of_measurement == homeassistant.const.TEMP_FAHRENHEIT | ||
| assert device.device_class == homeassistant.const.DEVICE_CLASS_TEMPERATURE | ||
| assert device.device_class == SensorDeviceClass.TEMPERATURE |
There was a problem hiding this comment.
This is not state attributes, so you should be able to use is here
| assert device.state == 38.9 | ||
| assert device.unit_of_measurement == homeassistant.const.TEMP_CELSIUS | ||
| assert device.device_class == homeassistant.const.DEVICE_CLASS_TEMPERATURE | ||
| assert device.device_class == SensorDeviceClass.TEMPERATURE |
There was a problem hiding this comment.
This is not state attributes, so you should be able to use is here
Breaking change
Proposed change
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: