Skip to content

Commit

Permalink
Merge pull request #12 from Brunas/fix/devcontainer-readme
Browse files Browse the repository at this point in the history
Fix/devcontainer readme
  • Loading branch information
Brunas authored Jul 28, 2024
2 parents 9adad5a + 7d1a5a4 commit b0b6b36
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 42 deletions.
70 changes: 37 additions & 33 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,51 @@
{
"name": "Home Assistant Dev Container",
"image": "homeassistant/home-assistant:stable",
"runArgs": [
"-e",
"GIT_EDTIOR='code --wait'"
],
"runArgs": [
"-e",
"GIT_EDTIOR='code --wait'"
],
"customizations": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-python.black-formatter",
"ms-python.autopep8",
"ms-python.pylint",
"ms-vscode.remote-containers",
"charliermarsh.ruff",
"yzhang.markdown-all-in-one",
"kevinrose.vsc-python-indent",
"keesschollaart.vscode-home-assistant",
"donjayamanne.githistory",
"mhutchie.git-graph",
"mikoz.black-py"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-python.black-formatter",
"ms-python.autopep8",
"ms-python.pylint",
"ms-vscode.remote-containers",
"charliermarsh.ruff",
"yzhang.markdown-all-in-one",
"kevinrose.vsc-python-indent",
"keesschollaart.vscode-home-assistant",
"donjayamanne.githistory",
"mhutchie.git-graph",
"mikoz.black-py"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.formatting.provider": "black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
}
}
},
"mounts": [
"source=${localWorkspaceFolder}/custom_components,target=/root/.homeassistant/custom_components,type=bind"
"source=${env:HOME}/.ssh,target=/root/.ssh,type=bind,readonly",
"source=${env:HOME}/.ssh/known_hosts,target=/root/.ssh/known_hosts,type=bind,readonly",
"source=${env:HOME}/.gitconfig,target=/root/.gitconfig,type=bind,readonly",
"source=${localWorkspaceFolder}/custom_components,target=/root/.homeassistant/custom_components,type=bind"
],
"forwardPorts": [
8123
],
"remoteEnv": {
"TZ": "Europe/Vilnius"
"TZ": "Europe/Vilnius"
},
"postCreateCommand": "pip install -r requirements.txt && hass"
"postCreateCommand": "pip install -r requirements.txt && hass",
"postStartCommand": "export PYTHONPATH=$(python -c 'import site; print(site.getsitepackages()[0])')"
}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## Release 0.2.1

Date: `2024-07-28`

### Changes

- Bumped meteo_lt-pkg to 0.2.1 to change UTC datetime format from "Z" to "+00:00"
- Devcontainer fixes and improvements
- Readme update

## Release 0.2.0

Date: `2024-07-27`

### Changes

- Separate sensors for every current conditions attribute
- Added last_updated to all entities to see coordinator working
- Trying to fix updating

## Release 0.1.8

Date: `2024-07-26`
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ Home Assistant integration for Meteo.Lt REST API

This integration adds support for retrieving the Forecast data from [Api.Meteo.Lt](https://api.meteo.lt) and setting up following platforms in Home Assistant:

Platform | Description
-- | --
`weather` | A Home Assistant `weather` entity, with current data, and hourly forecast data. The first forecast record is treated as current data.
`sensor` | A Home Assistant `sensor` entity, with all available data taken from the forecast first record.
Platform | Entity ID | Description
-- | -- | --
`weather`| `weather.meteo_lt_ABCD` | A Home Assistant `weather` entity, with current data, and hourly forecast data. The first forecast record is treated as current data.
`sensor` | `sensor.meteo_lt_ABCD_current_conditions` | Sensor with all available data taken from the forecast first record and native value set to `temperature`
`sensor` | `sensor.meteo_lt_ABCD_temperature` | Sensor with `temperature` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_apparent_temperature` | Sensor with `apparent_temperature` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_wind_speed` | Sensor with `wind_speed` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_wind_gust_speed` | Sensor with `wind_gust_speed` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_wind_bearing` | Sensor with `wind_bearing` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_cloud_coverage` | Sensor with `cloud_coverage` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_pressure` | Sensor with `pressure` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_humidity` | Sensor with `humidity` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_precipitation` | Sensor with `precipitation` attribute taken from the forecast first record
`sensor` | `sensor.meteo_lt_ABCD_condition` | Sensor with `condition` attribute taken from the forecast first record

Where `ABCD` is name of the nearest place calculated using place list downloaded from `api.meteo.lt`

Implementation has been done using Home Assistant version **2024.7.3**. Older versions could work too as long as the new Weather entity forecast types exist. Integration does **not** create Forecast Attributes.

Expand All @@ -39,7 +51,7 @@ If you are not familiar with HACS, or haven't installed it, I would recommend to
1. Restart Home Assistant
1. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Meteo.Lt":
- Enter latitude and longitude to use for the integration. Default values are Home Assistant Home location.
- Unlimitted number of locations is supported - `weather.meteo_lt_ABCD` and `sensor.meteo_lt_ABCD_current_conditions` entities are created where `ABCD` is name of the nearest calculated place from available places in api.meteo.lt. Note, that if an entity for the same place exists, new entity gets numeric suffix to the name.
- Unlimitted number of locations is supported. If an entity for the same place exists, new entity gets numeric suffix to the name.

## Enable Debug Logging

Expand Down
14 changes: 10 additions & 4 deletions custom_components/meteo_lt/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"domain": "meteo_lt",
"name": "Meteo.Lt",
"codeowners": ["@Brunas"],
"codeowners": [
"@Brunas"
],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/Brunas/meteo_lt",
"integration_type": "service",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/Brunas/meteo_lt/issues",
"loggers": ["meteo_lt"],
"requirements": ["meteo_lt-pkg==0.2.0"],
"version": "0.2.0"
"loggers": [
"meteo_lt"
],
"requirements": [
"meteo_lt-pkg==0.2.1"
],
"version": "0.2.1"
}
2 changes: 2 additions & 0 deletions custom_components/meteo_lt/sensor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""sensor.py"""

# pylint: disable=too-many-arguments

from typing import Dict, Any
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
Expand Down

0 comments on commit b0b6b36

Please sign in to comment.