Reduce missed coverage in zwave_js (#79571)

* Reduce missed coverage in zwave_js.climate and cover

* Add switch platform coverage

* Add select platform

* Add lock platform

* Remove one line of coverage from number platform

* update docstring
This commit is contained in:
Raman Gupta 2022-10-18 04:06:29 -04:00 committed by GitHub
parent c717fd19de
commit d4c28e04e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 160 additions and 28 deletions

View file

@ -113,10 +113,7 @@ class ZwaveVolumeNumberEntity(ZWaveBaseEntity, NumberEntity):
super().__init__(config_entry, driver, info)
max_value = cast(int, self.info.primary_value.metadata.max)
min_value = cast(int, self.info.primary_value.metadata.min)
self.correction_factor = max_value - min_value
# Fallback in case we can't properly calculate correction factor
if self.correction_factor == 0:
self.correction_factor = 1
self.correction_factor = (max_value - min_value) or 1
# Entity class attributes
self._attr_native_min_value = 0