parameters: (self)
docstring: Update the sensor.
docstring_summary: Update the sensor.
docstring_tokens: Update the sensor .
function: async def async_update(self):
          """Update the sensor."""
          # Send update "signal" to the component
          await update_data(self.hass, self.hass.data[DOMAIN_DATA]["throttle"])
  
          # Get new data (if any)
          updated = self.hass.data[DOMAIN_DATA]
  
          # Check the data and update the value.
          self._state = len(updated.get("potential", [])) - 1
          self._state = 0 if self._state < 0 else self._state
  
          # Set/update attributes
          self.attr = updated.get("potential", [])
function_tokens: async def async_update ( self ) : # Send update "signal" to the component await update_data ( self . hass , self . hass . data [ DOMAIN_DATA ] [ "throttle" ] ) # Get new data (if any) updated = self . hass . data [ DOMAIN_DATA ] # Check the data and update the value. self . _state = len ( updated . get ( "potential" , [ ] ) ) - 1 self . _state = 0 if self . _state < 0 else self . _state # Set/update attributes self . attr = updated . get ( "potential" , [ ] )