custom_components/broadlinkcover/cover.py
async def async_added_to_hass(self):
        """ Only cover position and confidence in that matters."""
        """ The rest is calculated from this attribute.        """
        old_state = await self.async_get_last_state()
        _LOGGER.debug(self._name + ': ' + 'async_added_to_hass :: oldState %s', old_state)
        if (old_state is not None and self.tc is not None and old_state.attributes.get(ATTR_CURRENT_POSITION) is not None):
            self.tc.set_position(int(old_state.attributes.get(ATTR_CURRENT_POSITION)))
        if (old_state is not None and old_state.attributes.get(ATTR_UNCONFIRMED_STATE) is not None):
         if type(old_state.attributes.get(ATTR_UNCONFIRMED_STATE)) == bool:
           self._assume_uncertain_position = old_state.attributes.get(ATTR_UNCONFIRMED_STATE)
         else:
           self._assume_uncertain_position = str(old_state.attributes.get(ATTR_UNCONFIRMED_STATE)) == str(True)
 Only cover position and confidence in that matters.
Only cover position and confidence in that matters.
Only cover position and confidence in that matters .
async def async_added_to_hass(self):
        old_state = await self.async_get_last_state()
        _LOGGER.debug(self._name + ': ' + 'async_added_to_hass :: oldState %s', old_state)
        if (old_state is not None and self.tc is not None and old_state.attributes.get(ATTR_CURRENT_POSITION) is not None):
            self.tc.set_position(int(old_state.attributes.get(ATTR_CURRENT_POSITION)))
        if (old_state is not None and old_state.attributes.get(ATTR_UNCONFIRMED_STATE) is not None):
         if type(old_state.attributes.get(ATTR_UNCONFIRMED_STATE)) == bool:
           self._assume_uncertain_position = old_state.attributes.get(ATTR_UNCONFIRMED_STATE)
         else:
           self._assume_uncertain_position = str(old_state.attributes.get(ATTR_UNCONFIRMED_STATE)) == str(True)
async def async_added_to_hass ( self ) : """ The rest is calculated from this attribute.        """ old_state = await self . async_get_last_state ( ) _LOGGER . debug ( self . _name + ': ' + 'async_added_to_hass :: oldState %s' , old_state ) if ( old_state is not None and self . tc is not None and old_state . attributes . get ( ATTR_CURRENT_POSITION ) is not None ) : self . tc . set_position ( int ( old_state . attributes . get ( ATTR_CURRENT_POSITION ) ) ) if ( old_state is not None and old_state . attributes . get ( ATTR_UNCONFIRMED_STATE ) is not None ) : if type ( old_state . attributes . get ( ATTR_UNCONFIRMED_STATE ) ) == bool : self . _assume_uncertain_position = old_state . attributes . get ( ATTR_UNCONFIRMED_STATE ) else : self . _assume_uncertain_position = str ( old_state . attributes . get ( ATTR_UNCONFIRMED_STATE ) ) == str ( True )
Only cover position and confidence in that matters.
Only cover position and confidence in that matters .
""" Only cover position and confidence in that matters.""" """ The rest is calculated from this attribute.        """
self