forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'home-assistant:dev' into dev
- Loading branch information
Showing
416 changed files
with
17,347 additions
and
8,533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,11 +29,11 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/[email protected].4 | ||
uses: github/codeql-action/[email protected].5 | ||
with: | ||
languages: python | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/[email protected].4 | ||
uses: github/codeql-action/[email protected].5 | ||
with: | ||
category: "/language:python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Entity classes for the AEMET OpenData integration.""" | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
from aemet_opendata.helpers import dict_nested_value | ||
|
||
from homeassistant.components.weather import Forecast | ||
from homeassistant.helpers.update_coordinator import CoordinatorEntity | ||
|
||
from .weather_update_coordinator import WeatherUpdateCoordinator | ||
|
||
|
||
class AemetEntity(CoordinatorEntity[WeatherUpdateCoordinator]): | ||
"""Define an AEMET entity.""" | ||
|
||
def get_aemet_forecast(self, forecast_mode: str) -> list[Forecast]: | ||
"""Return AEMET entity forecast by mode.""" | ||
return self.coordinator.data["forecast"][forecast_mode] | ||
|
||
def get_aemet_value(self, keys: list[str]) -> Any: | ||
"""Return AEMET entity value by keys.""" | ||
return dict_nested_value(self.coordinator.data["lib"], keys) |
Oops, something went wrong.