tibber/__init__.py
async def update_current_price_info(self):
        """Update current price info async."""
        query = gql(
            """
        {
          viewer {
            home(id: "%s") {
              currentSubscription {
                priceInfo {
                  current {
                    energy
                    tax
                    total
                    startsAt
                  }
                }
              }
            }
          }
        }
        """
            % self.home_id
        )
        price_info_temp = await self._tibber_control.execute(query)
        if not price_info_temp:
            _LOGGER.error("Could not find current price info.")
            return
        try:
            home = price_info_temp["viewer"]["home"]
            current_subscription = home["currentSubscription"]
            price_info = current_subscription["priceInfo"]["current"]
        except (KeyError, TypeError):
            _LOGGER.error("Could not find current price info.")
            return
        if price_info:
            self._current_price_info = price_info
async def update_current_price_info(self):
        """Update current price info async."""
        query = gql(
            """
        {
          viewer {
            home(id: "%s") {
              currentSubscription {
                priceInfo {
                  current {
                    energy
                    tax
                    total
                    startsAt
                  }
                }
              }
            }
          }
        }
        """
            % self.home_id
        )
        price_info_temp = await self._tibber_control.execute(query)
        if not price_info_temp:
            _LOGGER.error("Could not find current price info.")
            return
        try:
            home = price_info_temp["viewer"]["home"]
            current_subscription = home["currentSubscription"]
            price_info = current_subscription["priceInfo"]["current"]
        except (KeyError, TypeError):
            _LOGGER.error("Could not find current price info.")
            return
        if price_info:
            self._current_price_info = price_info
async def update_current_price_info ( self ) : query = gql ( """
        {
          viewer {
            home(id: "%s") {
              currentSubscription {
                priceInfo {
                  current {
                    energy
                    tax
                    total
                    startsAt
                  }
                }
              }
            }
          }
        }
        """ % self . home_id ) price_info_temp = await self . _tibber_control . execute ( query ) if not price_info_temp : _LOGGER . error ( "Could not find current price info." ) return try : home = price_info_temp [ "viewer" ] [ "home" ] current_subscription = home [ "currentSubscription" ] price_info = current_subscription [ "priceInfo" ] [ "current" ] except ( KeyError , TypeError ) : _LOGGER . error ( "Could not find current price info." ) return if price_info : self . _current_price_info = price_info
Update current price info async.
Update current price info async .