Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pre-commit-3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
CJNE authored Aug 18, 2024
2 parents fde2aee + 77d0176 commit ed017d0
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pip==24.0
pre-commit==3.6.2
black==24.2.0
black==24.4.2
flake8==7.0.0
reorder-python-imports==3.12.0
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4.1.2

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}

Expand All @@ -34,7 +34,7 @@ jobs:
- name: Install Python modules
run: |
pip install --constraint=.github/workflows/constraints.txt pre-commit black flake8 reorder-python-imports
pip install --constraint=.github/workflows/constraints.txt pre-commit black flake8
- name: Run pre-commit on all files
run: |
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Check out code from GitHub
uses: "actions/checkout@v4.1.2"
- name: Setup Python ${{ env.DEFAULT_PYTHON }}
uses: "actions/setup-python@v5.0.0"
uses: "actions/setup-python@v5.1.0"
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
Expand Down
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ repos:
language: system
types: [python]
require_serial: true
- id: reorder-python-imports
name: Reorder python imports
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=custom_components]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
Expand Down
5 changes: 2 additions & 3 deletions custom_components/myenergi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
For more details about this integration, please refer to
https://github.com/cjne/myenergi
"""

import asyncio
import logging
from datetime import timedelta
Expand Down Expand Up @@ -54,9 +55,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
for platform in PLATFORMS:
if entry.options.get(platform, True):
coordinator.platforms.append(platform)
hass.async_add_job(
hass.config_entries.async_forward_entry_setup(entry, platform)
)
await hass.config_entries.async_forward_entry_setups(entry, platform)

entry.add_update_listener(async_reload_entry)
return True
Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sensor platform for myenergi."""

import operator

from homeassistant.components.binary_sensor import BinarySensorEntity
Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Adds config flow for myenergi."""

import logging
import traceback

Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for myenergi."""

# Base component constants
NAME = "myenergi"
DOMAIN = "myenergi"
Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Diagnostics support for Daikin Diagnostics."""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MyenergiEntity class"""

import logging

from homeassistant.helpers.entity import EntityCategory
Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/number.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sensor platform for myenergi."""

from homeassistant.components.number import NumberEntity
from homeassistant.helpers.entity import EntityCategory

Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/select.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sensor platform for myenergi."""

import voluptuous as vol
from homeassistant.components.select import SelectEntity
from homeassistant.helpers import entity_platform
Expand Down
1 change: 1 addition & 0 deletions custom_components/myenergi/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sensor platform for myenergi."""

import operator

from homeassistant.components.sensor import SensorDeviceClass
Expand Down
5 changes: 2 additions & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pre-commit==3.7.1
black==24.2.0
black==24.2.2
flake8==7.0.0
reorder-python-imports==3.12.0
homeassistant
pymyenergi
pytest
pytest
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for myenergi integration."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Global fixtures for myenergi integration."""

from typing import Any
from unittest.mock import patch

Expand Down
1 change: 1 addition & 0 deletions tests/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for myenergi tests."""

from custom_components.myenergi.const import (
CONF_PASSWORD,
)
Expand Down
1 change: 1 addition & 0 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test myenergi config flow."""

from unittest.mock import patch

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test myenergi setup process."""

import pytest
from custom_components.myenergi import (
async_reload_entry,
Expand Down
1 change: 1 addition & 0 deletions tests/test_number.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test myenergi sensor."""

from unittest.mock import MagicMock

from homeassistant.components.number import DOMAIN as NUMBER_DOMAIN
Expand Down
1 change: 1 addition & 0 deletions tests/test_select.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test myenergi sensor."""

from unittest.mock import MagicMock

from homeassistant.components.select import DOMAIN as SELECT_DOMAIN
Expand Down
1 change: 1 addition & 0 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test myenergi sensor."""

from homeassistant.core import HomeAssistant

from . import setup_mock_myenergi_config_entry
Expand Down
1 change: 1 addition & 0 deletions tests/test_services.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test myenergi sensor."""

from unittest.mock import MagicMock

from homeassistant.const import ATTR_ENTITY_ID
Expand Down

0 comments on commit ed017d0

Please sign in to comment.