Skip to content

Commit

Permalink
fix device class for lightning strike (#33)
Browse files Browse the repository at this point in the history
* fix device class for lightning strike

* add missing device classes

* fix up devcontainer for python 3.11

* fix ha not starting in devcontainer

* cl add
  • Loading branch information
tlskinneriv committed Jul 14, 2023
1 parent b95ef18 commit 73734e6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ RUN ./setup.sh

# WORKDIR /workspaces

# # Install Python dependencies from requirements
# COPY requirements.txt ./
# Install Python dependencies from requirements
COPY .devcontainer/requirements.txt ./
# COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
# RUN pip3 install -r requirements.txt
RUN pip3 install -r requirements.txt
# COPY requirements_test.txt requirements_test_pre_commit.txt ./
# RUN pip3 install -r requirements_test.txt
# RUN rm -rf requirements.txt requirements_test.txt requirements_test_pre_commit.txt homeassistant/
RUN rm -rf requirements.txt requirements_test.txt requirements_test_pre_commit.txt homeassistant/

# Set the default shell to bash instead of sh
ENV SHELL /bin/bash
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"python.linting.pylintArgs": [
"--init-hook",
"import sys; sys.path.append('/srv/homeassistant/lib/python3.10/site-packages/')"
"import sys; sys.path.append('/srv/homeassistant/lib/python3.11/site-packages/')"
],
"python.autoComplete.extraPaths": [
"/srv/homeassistant/lib/python3.11/site-packages/"
]
},
// Add the IDs of extensions you want installed when the container is created.
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git+https://github.com/boto/botocore
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog],
and this project adheres to [Semantic Versioning].

## [Unreleased] - 2023-07-13

### Fixed

- Lightning Strike Distance fixed to be `distance` device class
- Device class added for evapotranspiration and GDD sensors
- Housekeeping: updated devcontainer configuation for Python 3.11

## [1.1.2] - 2023-06-16

### Fixed
Expand Down
4 changes: 4 additions & 0 deletions custom_components/awnet_local/const_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,15 @@
name="Evapotranspiration Short",
icon="mdi:waves-arrow-up",
native_unit_of_measurement=UnitOfVolumetricFlux.INCHES_PER_DAY,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
key=TYPE_ETRS,
name="Evapotranspiration Tall",
icon="mdi:waves-arrow-up",
native_unit_of_measurement=UnitOfVolumetricFlux.INCHES_PER_DAY,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
Expand Down Expand Up @@ -436,6 +438,7 @@
name="Growing Degree Days",
icon="mdi:sprout",
native_unit_of_measurement=UnitOfTime.DAYS,
device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
Expand Down Expand Up @@ -604,6 +607,7 @@
name="Lightning Strike Distance",
icon="mdi:lightning-bolt",
native_unit_of_measurement=UnitOfLength.KILOMETERS,
device_class=SensorDeviceClass.DISTANCE,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
Expand Down

0 comments on commit 73734e6

Please sign in to comment.