Remove unnecessary boolean checks for callables (#78819)

This commit is contained in:
Marc Mueller 2022-09-26 04:01:27 +02:00 committed by GitHub
parent c6fd2bde46
commit faad904cbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -128,7 +128,6 @@ class InverterNumberEntity(NumberEntity):
async def async_set_native_value(self, value: float) -> None: async def async_set_native_value(self, value: float) -> None:
"""Set new value.""" """Set new value."""
if self.entity_description.setter: await self.entity_description.setter(self._inverter, int(value))
await self.entity_description.setter(self._inverter, int(value))
self._attr_native_value = value self._attr_native_value = value
self.async_write_ha_state() self.async_write_ha_state()

View file

@ -797,4 +797,4 @@ class PlenticoreDataSensor(CoordinatorEntity, SensorEntity):
raw_value = self.coordinator.data[self.module_id][self.data_id] raw_value = self.coordinator.data[self.module_id][self.data_id]
return self._formatter(raw_value) if self._formatter else raw_value return self._formatter(raw_value)

View file

@ -134,7 +134,7 @@ class SchemaCommonFlowHandler:
self._options.update(user_input) self._options.update(user_input)
next_step_id: str = step_id next_step_id: str = step_id
if form_step.next_step and (user_input is not None or form_step.schema is None): if user_input is not None or form_step.schema is None:
# Get next step # Get next step
next_step_id_or_end_flow = form_step.next_step(self._options) next_step_id_or_end_flow = form_step.next_step(self._options)
if next_step_id_or_end_flow is None: if next_step_id_or_end_flow is None: