@callback
def async_write_ha_state(self) -> None:
    'Write the state to the state machine.'
    if (self.hass is None):
        raise RuntimeError(f'Attribute hass is None for {self}')
    if (self.entity_id is None):
        raise NoEntitySpecifiedError(f'No entity id specified for entity {self.name}')
    self._async_write_ha_state()
Write the state to the state machine.
@callback
def async_write_ha_state(self) -> None:
    
    if (self.hass is None):
        raise RuntimeError(f'Attribute hass is None for {self}')
    if (self.entity_id is None):
        raise NoEntitySpecifiedError(f'No entity id specified for entity {self.name}')
    self._async_write_ha_state()