(self, hass: HomeAssistant, config: Config, state: State)
Initialize a trait for a state.
Initialize a trait for a state.
Initialize a trait for a state .
def __init__(self, hass: HomeAssistant, config: Config, state: State):
        """Initialize a trait for a state."""
        self.hass = hass
        self.state = state

        self.entity_config = config.get_entity_config(state.entity_id)
        self.reportable = config.is_reporting_state

        self._cache = config.cache
def __init__ ( self , hass : HomeAssistant , config : Config , state : State ) : self . hass = hass self . state = state self . entity_config = config . get_entity_config ( state . entity_id ) self . reportable = config . is_reporting_state self . _cache = config . cache