diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95bc45ce8..d3b9be6f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,6 +52,12 @@ jobs: - name: Fetch HA pyproject id: core-version run: wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml" + - name: Core dependencies + id: core-dependencies-1 + run: sudo apt-get update + - name: Core dependencies + id: core-dependencies-2 + run: sudo apt-get install python3-pip python3-dev python3-venv autoconf libssl-dev libxml2-dev libxslt1-dev libjpeg-dev libffi-dev libudev-dev zlib1g-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev ffmpeg libgammu-dev build-essential - name: Compute cache key id: set-key run: echo "cache-key=${{ runner.os }}--${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml', 'ha_pyproject.toml') }}" >> "$GITHUB_OUTPUT" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ba72cf0b..d40126d29 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,14 +52,22 @@ repos: - id: yamllint name: "Linting yaml" - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.10.0.1 + rev: v0.11.0.1 hooks: - id: shellcheck name: "Shell checking" args: - --external-sources + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.7.4 + hooks: + - id: prettier + additional_dependencies: + - prettier@3.6.2 + - prettier-plugin-sort-json@4.1.1 + name: "Prettier (JSON sorting)" - repo: https://github.com/biomejs/pre-commit - rev: v2.3.11 + rev: v2.3.10 hooks: - id: biome-lint additional_dependencies: ["@biomejs/biome@1.8.3"] diff --git a/.prettierignore b/.prettierignore index a284e8fb8..cd661cb05 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,5 @@ -custom_components/plugwise/manifest.json \ No newline at end of file +*.md +*.yaml +tests +.github +.prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..3f046af9f --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,24 @@ +/** @type {import("prettier").Config} */ +module.exports = { + overrides: [ + { + files: "./custom_components/**/*.json", + options: { + plugins: [require.resolve("prettier-plugin-sort-json")], + jsonRecursiveSort: true, + jsonSortOrder: JSON.stringify({ [/.*/]: "numeric" }), + }, + }, + { + files: ["manifest.json", "./**/brands/*.json"], + options: { + // domain and name should stay at the top + jsonSortOrder: JSON.stringify({ + domain: null, + name: null, + [/.*/]: "numeric", + }), + }, + }, + ], +}; diff --git a/custom_components/plugwise/icons.json b/custom_components/plugwise/icons.json index c6da8bb91..2f6f218e1 100644 --- a/custom_components/plugwise/icons.json +++ b/custom_components/plugwise/icons.json @@ -66,11 +66,11 @@ "dhw_mode": { "default": "mdi:shower", "state": { + "auto": "mdi:auto-mode", + "boost": "mdi:rocket-launch", "comfort": "mdi:sofa", "eco": "mdi:leaf", - "off": "mdi:circle-off-outline", - "boost": "mdi:rocket-launch", - "auto": "mdi:auto-mode" + "off": "mdi:circle-off-outline" } }, "gateway_mode": { @@ -84,11 +84,11 @@ "regulation_mode": { "default": "mdi:hvac", "state": { - "bleeding_hot": "mdi:fire-circle", "bleeding_cold": "mdi:water-circle", - "off": "mdi:circle-off-outline", + "bleeding_hot": "mdi:fire-circle", + "cooling": "mdi:snowflake", "heating": "mdi:radiator", - "cooling": "mdi:snowflake" + "off": "mdi:circle-off-outline" } }, "select_schedule": { diff --git a/custom_components/plugwise/strings.json b/custom_components/plugwise/strings.json index d7434a97c..2ccdc118e 100644 --- a/custom_components/plugwise/strings.json +++ b/custom_components/plugwise/strings.json @@ -1,40 +1,10 @@ { - "options": { - "step": { - "none": { - "title": "No Options available", - "description": "This Integration does not provide any Options" - }, - "init": { - "description": "Adjust Smile/Stretch Options", - "data": { - "cooling_on": "Anna: cooling-mode is on", - "scan_interval": "Scan Interval (seconds) *) beta-only option", - "homekit_emulation": "Homekit emulation (i.e. on hvac_off => Away) *) beta-only option", - "refresh_interval": "Frontend refresh-time (1.5 - 5 seconds) *) beta-only option" - } - } - } - }, "config": { - "step": { - "reconfigure": { - "description": "Update configuration for {title}.", - "data": { - "host": "IP-address", - "port": "Port number" - } - }, - "user": { - "title": "Set up Plugwise Adam/Smile/Stretch", - "description": "Enter your Plugwise device: (setup can take up to 90s)", - "data": { - "password": "ID", - "username": "Username", - "host": "IP-address", - "port": "Port number" - } - } + "abort": { + "already_configured": "This device is already configured", + "anna_with_adam": "Both Anna and Adam detected. Add your Adam instead of your Anna", + "not_the_same_smile": "The configured Smile ID does not match the Smile ID on the requested IP address.", + "reconfigure_successful": "Reconfiguration successful" }, "error": { "cannot_connect": "Failed to connect", @@ -47,11 +17,24 @@ "unknown": "Unknown error!", "unsupported": "Device with unsupported firmware" }, - "abort": { - "already_configured": "This device is already configured", - "anna_with_adam": "Both Anna and Adam detected. Add your Adam instead of your Anna", - "not_the_same_smile": "The configured Smile ID does not match the Smile ID on the requested IP address.", - "reconfigure_successful": "Reconfiguration successful" + "step": { + "reconfigure": { + "data": { + "host": "IP-address", + "port": "Port number" + }, + "description": "Update configuration for {title}." + }, + "user": { + "data": { + "host": "IP-address", + "password": "ID", + "port": "Port number", + "username": "Username" + }, + "description": "Enter your Plugwise device: (setup can take up to 90s)", + "title": "Set up Plugwise Adam/Smile/Stretch" + } } }, "entity": { @@ -62,6 +45,9 @@ "cooling_enabled": { "name": "Cooling enabled" }, + "cooling_state": { + "name": "Cooling" + }, "dhw_state": { "name": "DHW state" }, @@ -71,14 +57,14 @@ "heating_state": { "name": "Heating" }, - "cooling_state": { - "name": "Cooling" - }, - "secondary_boiler_state": { - "name": "Secondary boiler state" + "low_battery": { + "name": "Battery status" }, "plugwise_notification": { "name": "Plugwise notification" + }, + "secondary_boiler_state": { + "name": "Secondary boiler state" } }, "button": { @@ -102,12 +88,12 @@ } }, "number": { - "maximum_boiler_temperature": { - "name": "Maximum boiler temperature setpoint" - }, "max_dhw_temperature": { "name": "Domestic hot water setpoint" }, + "maximum_boiler_temperature": { + "name": "Maximum boiler temperature setpoint" + }, "temperature_offset": { "name": "Temperature offset" } @@ -122,6 +108,14 @@ "off": "Off" } }, + "select_gateway_mode": { + "name": "Gateway mode", + "state": { + "away": "Pause", + "full": "Normal", + "vacation": "Vacation" + } + }, "select_regulation_mode": { "name": "Regulation mode", "state": { @@ -132,14 +126,6 @@ "off": "Off" } }, - "select_gateway_mode": { - "name": "Gateway mode", - "state": { - "away": "Pause", - "full": "Normal", - "vacation": "Vacation" - } - }, "select_schedule": { "name": "Thermostat schedule", "state": { @@ -156,143 +142,143 @@ } }, "sensor": { - "setpoint": { - "name": "Setpoint" - }, "cooling_setpoint": { "name": "Cooling setpoint" }, - "heating_setpoint": { - "name": "Heating setpoint" - }, - "intended_boiler_temperature": { - "name": "Intended boiler temperature" - }, - "temperature_difference": { - "name": "Temperature difference" - }, - "outdoor_temperature": { - "name": "Outdoor temperature" - }, - "outdoor_air_temperature": { - "name": "Outdoor air temperature" - }, - "water_temperature": { - "name": "Water temperature" + "dhw_temperature": { + "name": "DHW temperature" }, - "return_temperature": { - "name": "Return temperature" + "domestic_hot_water_setpoint": { + "name": "DHW setpoint" }, "electricity_consumed": { "name": "Electricity consumed" }, - "electricity_produced": { - "name": "Electricity produced" - }, - "electricity_consumed_point": { - "name": "Electricity consumed point" - }, - "electricity_produced_point": { - "name": "Electricity produced point" - }, "electricity_consumed_interval": { "name": "Electricity consumed interval" }, - "electricity_consumed_peak_interval": { - "name": "Electricity consumed peak interval" + "electricity_consumed_off_peak_cumulative": { + "name": "Electricity consumed off-peak cumulative" }, "electricity_consumed_off_peak_interval": { "name": "Electricity consumed off-peak interval" }, - "electricity_produced_interval": { - "name": "Electricity produced interval" - }, - "electricity_produced_peak_interval": { - "name": "Electricity produced peak interval" - }, - "electricity_produced_off_peak_interval": { - "name": "Electricity produced off-peak interval" - }, "electricity_consumed_off_peak_point": { "name": "Electricity consumed off-peak point" }, - "electricity_consumed_peak_point": { - "name": "Electricity consumed peak point" - }, - "electricity_consumed_off_peak_cumulative": { - "name": "Electricity consumed off-peak cumulative" - }, "electricity_consumed_peak_cumulative": { "name": "Electricity consumed peak cumulative" }, - "electricity_produced_off_peak_point": { - "name": "Electricity produced off-peak point" - }, - "electricity_produced_peak_point": { - "name": "Electricity produced peak point" + "electricity_consumed_peak_interval": { + "name": "Electricity consumed peak interval" }, - "electricity_produced_off_peak_cumulative": { - "name": "Electricity produced off-peak cumulative" + "electricity_consumed_peak_point": { + "name": "Electricity consumed peak point" }, - "electricity_produced_peak_cumulative": { - "name": "Electricity produced peak cumulative" + "electricity_consumed_point": { + "name": "Electricity consumed point" }, "electricity_phase_one_consumed": { "name": "Electricity phase one consumed" }, - "electricity_phase_two_consumed": { - "name": "Electricity phase two consumed" + "electricity_phase_one_produced": { + "name": "Electricity phase one produced" }, "electricity_phase_three_consumed": { "name": "Electricity phase three consumed" }, - "electricity_phase_one_produced": { - "name": "Electricity phase one produced" + "electricity_phase_three_produced": { + "name": "Electricity phase three produced" + }, + "electricity_phase_two_consumed": { + "name": "Electricity phase two consumed" }, "electricity_phase_two_produced": { "name": "Electricity phase two produced" }, - "electricity_phase_three_produced": { - "name": "Electricity phase three produced" + "electricity_produced": { + "name": "Electricity produced" }, - "voltage_phase_one": { - "name": "Voltage phase one" + "electricity_produced_interval": { + "name": "Electricity produced interval" }, - "voltage_phase_two": { - "name": "Voltage phase two" + "electricity_produced_off_peak_cumulative": { + "name": "Electricity produced off-peak cumulative" }, - "voltage_phase_three": { - "name": "Voltage phase three" + "electricity_produced_off_peak_interval": { + "name": "Electricity produced off-peak interval" }, - "gas_consumed_interval": { - "name": "Gas consumed interval" + "electricity_produced_off_peak_point": { + "name": "Electricity produced off-peak point" + }, + "electricity_produced_peak_cumulative": { + "name": "Electricity produced peak cumulative" + }, + "electricity_produced_peak_interval": { + "name": "Electricity produced peak interval" + }, + "electricity_produced_peak_point": { + "name": "Electricity produced peak point" + }, + "electricity_produced_point": { + "name": "Electricity produced point" }, "gas_consumed_cumulative": { "name": "Gas consumed cumulative" }, - "net_electricity_point": { - "name": "Net electricity point" + "gas_consumed_interval": { + "name": "Gas consumed interval" }, - "net_electricity_cumulative": { - "name": "Net electricity cumulative" + "heating_setpoint": { + "name": "Heating setpoint" + }, + "intended_boiler_temperature": { + "name": "Intended boiler temperature" + }, + "maximum_boiler_temperature": { + "name": "Maximum boiler temperature setpoint" }, "modulation_level": { "name": "Modulation level" }, + "net_electricity_cumulative": { + "name": "Net electricity cumulative" + }, + "net_electricity_point": { + "name": "Net electricity point" + }, + "outdoor_air_temperature": { + "name": "Outdoor air temperature" + }, + "outdoor_temperature": { + "name": "Outdoor temperature" + }, + "return_temperature": { + "name": "Return temperature" + }, + "setpoint": { + "name": "Setpoint" + }, + "temperature_difference": { + "name": "Temperature difference" + }, "valve_position": { "name": "Valve position" }, - "water_pressure": { - "name": "Water pressure" + "voltage_phase_one": { + "name": "Voltage phase one" }, - "dhw_temperature": { - "name": "DHW temperature" + "voltage_phase_three": { + "name": "Voltage phase three" }, - "domestic_hot_water_setpoint": { - "name": "DHW setpoint" + "voltage_phase_two": { + "name": "Voltage phase two" }, - "maximum_boiler_temperature": { - "name": "Maximum boiler temperature setpoint" + "water_pressure": { + "name": "Water pressure" + }, + "water_temperature": { + "name": "Water temperature" } }, "switch": { @@ -336,10 +322,27 @@ "message": "Device with unsupported firmware" } }, + "options": { + "step": { + "init": { + "data": { + "cooling_on": "Anna: cooling-mode is on", + "homekit_emulation": "Homekit emulation (i.e. on hvac_off => Away) *) beta-only option", + "refresh_interval": "Frontend refresh-time (1.5 - 5 seconds) *) beta-only option", + "scan_interval": "Scan Interval (seconds) *) beta-only option" + }, + "description": "Adjust Smile/Stretch Options" + }, + "none": { + "description": "This Integration does not provide any Options", + "title": "No Options available" + } + } + }, "services": { "delete_notification": { - "name": "Delete Plugwise notification", - "description": "Deletes a Plugwise Notification" + "description": "Deletes a Plugwise Notification", + "name": "Delete Plugwise notification" } } } diff --git a/custom_components/plugwise/translations/en.json b/custom_components/plugwise/translations/en.json index 388ad0073..2ccdc118e 100644 --- a/custom_components/plugwise/translations/en.json +++ b/custom_components/plugwise/translations/en.json @@ -1,345 +1,348 @@ { - "config": { - "abort": { - "already_configured": "This device is already configured", - "anna_with_adam": "Both Anna and Adam detected. Add your Adam instead of your Anna", - "not_the_same_smile": "The configured Smile ID does not match the Smile ID on the requested IP address.", - "reconfigure_successful": "Reconfiguration successful" - }, - "error": { - "cannot_connect": "Failed to connect", - "invalid_auth": "Authentication failed", - "invalid_setup": "Add your Adam instead of your Anna, see the documentation", - "network_down": "Plugwise Zigbee network is down", - "network_timeout": "Network communication timeout", - "response_error": "Invalid XML data, or error indication received from the Plugwise Adam/Smile/Stretch", - "stick_init": "Initialization of Plugwise USB-stick failed", - "unknown": "Unknown error!", - "unsupported": "Device with unsupported firmware" - }, - "step": { - "reconfigure": { - "data": { - "host": "IP-address", - "port": "Port number" - }, - "description": "Update configuration for {title}." - }, - "user": { - "data": { - "host": "IP-address", - "password": "ID", - "port": "Port number", - "username": "Username" - }, - "description": "Enter your Plugwise device: (setup can take up to 90s)", - "title": "Set up Plugwise Adam/Smile/Stretch" - } - } + "config": { + "abort": { + "already_configured": "This device is already configured", + "anna_with_adam": "Both Anna and Adam detected. Add your Adam instead of your Anna", + "not_the_same_smile": "The configured Smile ID does not match the Smile ID on the requested IP address.", + "reconfigure_successful": "Reconfiguration successful" }, - "entity": { - "binary_sensor": { - "compressor_state": { - "name": "Compressor state" - }, - "cooling_enabled": { - "name": "Cooling enabled" - }, - "cooling_state": { - "name": "Cooling" - }, - "dhw_state": { - "name": "DHW state" - }, - "flame_state": { - "name": "Flame state" - }, - "heating_state": { - "name": "Heating" - }, - "plugwise_notification": { - "name": "Plugwise notification" - }, - "secondary_boiler_state": { - "name": "Secondary boiler state" - } - }, - "button": { - "reboot": { - "name": "Reboot" - } - }, - "climate": { - "plugwise": { - "state_attributes": { - "preset_mode": { - "state": { - "asleep": "Night", - "away": "Away", - "home": "Home", - "no_frost": "Anti-frost", - "vacation": "Vacation" - } - } - } - } - }, - "number": { - "max_dhw_temperature": { - "name": "Domestic hot water setpoint" - }, - "maximum_boiler_temperature": { - "name": "Maximum boiler temperature setpoint" - }, - "temperature_offset": { - "name": "Temperature offset" - } - }, - "select": { - "select_dhw_mode": { - "name": "DHW mode", - "state": { - "auto": "Auto", - "boost": "Boost", - "comfort": "Comfort", - "off": "Off" - } - }, - "select_gateway_mode": { - "name": "Gateway mode", - "state": { - "away": "Pause", - "full": "Normal", - "vacation": "Vacation" - } - }, - "select_regulation_mode": { - "name": "Regulation mode", - "state": { - "bleeding_cold": "Bleeding cold", - "bleeding_hot": "Bleeding hot", - "cooling": "Cooling", - "heating": "Heating", - "off": "Off" - } - }, - "select_schedule": { - "name": "Thermostat schedule", - "state": { - "off": "Off" - } - }, - "select_zone_profile": { - "name": "Zone profile", - "state": { - "active": "Active", - "off": "Off", - "passive": "Passive" - } - } - }, - "sensor": { - "cooling_setpoint": { - "name": "Cooling setpoint" - }, - "dhw_temperature": { - "name": "DHW temperature" - }, - "domestic_hot_water_setpoint": { - "name": "DHW setpoint" - }, - "electricity_consumed": { - "name": "Electricity consumed" - }, - "electricity_consumed_interval": { - "name": "Electricity consumed interval" - }, - "electricity_consumed_off_peak_cumulative": { - "name": "Electricity consumed off-peak cumulative" - }, - "electricity_consumed_off_peak_interval": { - "name": "Electricity consumed off-peak interval" - }, - "electricity_consumed_off_peak_point": { - "name": "Electricity consumed off-peak point" - }, - "electricity_consumed_peak_cumulative": { - "name": "Electricity consumed peak cumulative" - }, - "electricity_consumed_peak_interval": { - "name": "Electricity consumed peak interval" - }, - "electricity_consumed_peak_point": { - "name": "Electricity consumed peak point" - }, - "electricity_consumed_point": { - "name": "Electricity consumed point" - }, - "electricity_phase_one_consumed": { - "name": "Electricity phase one consumed" - }, - "electricity_phase_one_produced": { - "name": "Electricity phase one produced" - }, - "electricity_phase_three_consumed": { - "name": "Electricity phase three consumed" - }, - "electricity_phase_three_produced": { - "name": "Electricity phase three produced" - }, - "electricity_phase_two_consumed": { - "name": "Electricity phase two consumed" - }, - "electricity_phase_two_produced": { - "name": "Electricity phase two produced" - }, - "electricity_produced": { - "name": "Electricity produced" - }, - "electricity_produced_interval": { - "name": "Electricity produced interval" - }, - "electricity_produced_off_peak_cumulative": { - "name": "Electricity produced off-peak cumulative" - }, - "electricity_produced_off_peak_interval": { - "name": "Electricity produced off-peak interval" - }, - "electricity_produced_off_peak_point": { - "name": "Electricity produced off-peak point" - }, - "electricity_produced_peak_cumulative": { - "name": "Electricity produced peak cumulative" - }, - "electricity_produced_peak_interval": { - "name": "Electricity produced peak interval" - }, - "electricity_produced_peak_point": { - "name": "Electricity produced peak point" - }, - "electricity_produced_point": { - "name": "Electricity produced point" - }, - "gas_consumed_cumulative": { - "name": "Gas consumed cumulative" - }, - "gas_consumed_interval": { - "name": "Gas consumed interval" - }, - "heating_setpoint": { - "name": "Heating setpoint" - }, - "intended_boiler_temperature": { - "name": "Intended boiler temperature" - }, - "maximum_boiler_temperature": { - "name": "Maximum boiler temperature setpoint" - }, - "modulation_level": { - "name": "Modulation level" - }, - "net_electricity_cumulative": { - "name": "Net electricity cumulative" - }, - "net_electricity_point": { - "name": "Net electricity point" - }, - "outdoor_air_temperature": { - "name": "Outdoor air temperature" - }, - "outdoor_temperature": { - "name": "Outdoor temperature" - }, - "return_temperature": { - "name": "Return temperature" - }, - "setpoint": { - "name": "Setpoint" - }, - "temperature_difference": { - "name": "Temperature difference" - }, - "valve_position": { - "name": "Valve position" - }, - "voltage_phase_one": { - "name": "Voltage phase one" - }, - "voltage_phase_three": { - "name": "Voltage phase three" - }, - "voltage_phase_two": { - "name": "Voltage phase two" - }, - "water_pressure": { - "name": "Water pressure" - }, - "water_temperature": { - "name": "Water temperature" - } - }, - "switch": { - "cooling_ena_switch": { - "name": "Cooling" - }, - "dhw_cm_switch": { - "name": "DHW comfort mode" - }, - "lock": { - "name": "Lock" - }, - "relay": { - "name": "Relay" - } - } + "error": { + "cannot_connect": "Failed to connect", + "invalid_auth": "Authentication failed", + "invalid_setup": "Add your Adam instead of your Anna, see the documentation", + "network_down": "Plugwise Zigbee network is down", + "network_timeout": "Network communication timeout", + "response_error": "Invalid XML data, or error indication received from the Plugwise Adam/Smile/Stretch", + "stick_init": "Initialization of Plugwise USB-stick failed", + "unknown": "Unknown error!", + "unsupported": "Device with unsupported firmware" }, - "exceptions": { - "authentication_failed": { - "message": "Invalid authentication" - }, - "data_incomplete_or_missing": { - "message": "Data incomplete or missing." - }, - "error_communicating_with_api": { - "message": "Error communicating with API: {error}." - }, - "failed_to_connect": { - "message": "Failed to connect" - }, - "invalid_setup": { - "message": "Add your Adam instead of your Anna, see the documentation" + "step": { + "reconfigure": { + "data": { + "host": "IP-address", + "port": "Port number" }, - "response_error": { - "message": "Invalid XML data, or error indication received from the Plugwise Adam/Smile/Stretch" + "description": "Update configuration for {title}." + }, + "user": { + "data": { + "host": "IP-address", + "password": "ID", + "port": "Port number", + "username": "Username" }, - "set_schedule_first": { - "message": "Failed setting HVACMode, set a schedule first." - }, - "unsupported_firmware": { - "message": "Device with unsupported firmware" - } + "description": "Enter your Plugwise device: (setup can take up to 90s)", + "title": "Set up Plugwise Adam/Smile/Stretch" + } + } + }, + "entity": { + "binary_sensor": { + "compressor_state": { + "name": "Compressor state" + }, + "cooling_enabled": { + "name": "Cooling enabled" + }, + "cooling_state": { + "name": "Cooling" + }, + "dhw_state": { + "name": "DHW state" + }, + "flame_state": { + "name": "Flame state" + }, + "heating_state": { + "name": "Heating" + }, + "low_battery": { + "name": "Battery status" + }, + "plugwise_notification": { + "name": "Plugwise notification" + }, + "secondary_boiler_state": { + "name": "Secondary boiler state" + } }, - "options": { - "step": { - "init": { - "data": { - "cooling_on": "Anna: cooling-mode is on", - "homekit_emulation": "Homekit emulation (i.e. on hvac_off => Away) *) beta-only option", - "refresh_interval": "Frontend refresh-time (1.5 - 5 seconds) *) beta-only option", - "scan_interval": "Scan Interval (seconds) *) beta-only option" - }, - "description": "Adjust Smile/Stretch Options" - }, - "none": { - "description": "This Integration does not provide any Options", - "title": "No Options available" + "button": { + "reboot": { + "name": "Reboot" + } + }, + "climate": { + "plugwise": { + "state_attributes": { + "preset_mode": { + "state": { + "asleep": "Night", + "away": "Away", + "home": "Home", + "no_frost": "Anti-frost", + "vacation": "Vacation" } + } } + } + }, + "number": { + "max_dhw_temperature": { + "name": "Domestic hot water setpoint" + }, + "maximum_boiler_temperature": { + "name": "Maximum boiler temperature setpoint" + }, + "temperature_offset": { + "name": "Temperature offset" + } }, - "services": { - "delete_notification": { - "description": "Deletes a Plugwise Notification", - "name": "Delete Plugwise notification" + "select": { + "select_dhw_mode": { + "name": "DHW mode", + "state": { + "auto": "Auto", + "boost": "Boost", + "comfort": "Comfort", + "off": "Off" + } + }, + "select_gateway_mode": { + "name": "Gateway mode", + "state": { + "away": "Pause", + "full": "Normal", + "vacation": "Vacation" } + }, + "select_regulation_mode": { + "name": "Regulation mode", + "state": { + "bleeding_cold": "Bleeding cold", + "bleeding_hot": "Bleeding hot", + "cooling": "Cooling", + "heating": "Heating", + "off": "Off" + } + }, + "select_schedule": { + "name": "Thermostat schedule", + "state": { + "off": "Off" + } + }, + "select_zone_profile": { + "name": "Zone profile", + "state": { + "active": "Active", + "off": "Off", + "passive": "Passive" + } + } + }, + "sensor": { + "cooling_setpoint": { + "name": "Cooling setpoint" + }, + "dhw_temperature": { + "name": "DHW temperature" + }, + "domestic_hot_water_setpoint": { + "name": "DHW setpoint" + }, + "electricity_consumed": { + "name": "Electricity consumed" + }, + "electricity_consumed_interval": { + "name": "Electricity consumed interval" + }, + "electricity_consumed_off_peak_cumulative": { + "name": "Electricity consumed off-peak cumulative" + }, + "electricity_consumed_off_peak_interval": { + "name": "Electricity consumed off-peak interval" + }, + "electricity_consumed_off_peak_point": { + "name": "Electricity consumed off-peak point" + }, + "electricity_consumed_peak_cumulative": { + "name": "Electricity consumed peak cumulative" + }, + "electricity_consumed_peak_interval": { + "name": "Electricity consumed peak interval" + }, + "electricity_consumed_peak_point": { + "name": "Electricity consumed peak point" + }, + "electricity_consumed_point": { + "name": "Electricity consumed point" + }, + "electricity_phase_one_consumed": { + "name": "Electricity phase one consumed" + }, + "electricity_phase_one_produced": { + "name": "Electricity phase one produced" + }, + "electricity_phase_three_consumed": { + "name": "Electricity phase three consumed" + }, + "electricity_phase_three_produced": { + "name": "Electricity phase three produced" + }, + "electricity_phase_two_consumed": { + "name": "Electricity phase two consumed" + }, + "electricity_phase_two_produced": { + "name": "Electricity phase two produced" + }, + "electricity_produced": { + "name": "Electricity produced" + }, + "electricity_produced_interval": { + "name": "Electricity produced interval" + }, + "electricity_produced_off_peak_cumulative": { + "name": "Electricity produced off-peak cumulative" + }, + "electricity_produced_off_peak_interval": { + "name": "Electricity produced off-peak interval" + }, + "electricity_produced_off_peak_point": { + "name": "Electricity produced off-peak point" + }, + "electricity_produced_peak_cumulative": { + "name": "Electricity produced peak cumulative" + }, + "electricity_produced_peak_interval": { + "name": "Electricity produced peak interval" + }, + "electricity_produced_peak_point": { + "name": "Electricity produced peak point" + }, + "electricity_produced_point": { + "name": "Electricity produced point" + }, + "gas_consumed_cumulative": { + "name": "Gas consumed cumulative" + }, + "gas_consumed_interval": { + "name": "Gas consumed interval" + }, + "heating_setpoint": { + "name": "Heating setpoint" + }, + "intended_boiler_temperature": { + "name": "Intended boiler temperature" + }, + "maximum_boiler_temperature": { + "name": "Maximum boiler temperature setpoint" + }, + "modulation_level": { + "name": "Modulation level" + }, + "net_electricity_cumulative": { + "name": "Net electricity cumulative" + }, + "net_electricity_point": { + "name": "Net electricity point" + }, + "outdoor_air_temperature": { + "name": "Outdoor air temperature" + }, + "outdoor_temperature": { + "name": "Outdoor temperature" + }, + "return_temperature": { + "name": "Return temperature" + }, + "setpoint": { + "name": "Setpoint" + }, + "temperature_difference": { + "name": "Temperature difference" + }, + "valve_position": { + "name": "Valve position" + }, + "voltage_phase_one": { + "name": "Voltage phase one" + }, + "voltage_phase_three": { + "name": "Voltage phase three" + }, + "voltage_phase_two": { + "name": "Voltage phase two" + }, + "water_pressure": { + "name": "Water pressure" + }, + "water_temperature": { + "name": "Water temperature" + } + }, + "switch": { + "cooling_ena_switch": { + "name": "Cooling" + }, + "dhw_cm_switch": { + "name": "DHW comfort mode" + }, + "lock": { + "name": "Lock" + }, + "relay": { + "name": "Relay" + } + } + }, + "exceptions": { + "authentication_failed": { + "message": "Invalid authentication" + }, + "data_incomplete_or_missing": { + "message": "Data incomplete or missing." + }, + "error_communicating_with_api": { + "message": "Error communicating with API: {error}." + }, + "failed_to_connect": { + "message": "Failed to connect" + }, + "invalid_setup": { + "message": "Add your Adam instead of your Anna, see the documentation" + }, + "response_error": { + "message": "Invalid XML data, or error indication received from the Plugwise Adam/Smile/Stretch" + }, + "set_schedule_first": { + "message": "Failed setting HVACMode, set a schedule first." + }, + "unsupported_firmware": { + "message": "Device with unsupported firmware" + } + }, + "options": { + "step": { + "init": { + "data": { + "cooling_on": "Anna: cooling-mode is on", + "homekit_emulation": "Homekit emulation (i.e. on hvac_off => Away) *) beta-only option", + "refresh_interval": "Frontend refresh-time (1.5 - 5 seconds) *) beta-only option", + "scan_interval": "Scan Interval (seconds) *) beta-only option" + }, + "description": "Adjust Smile/Stretch Options" + }, + "none": { + "description": "This Integration does not provide any Options", + "title": "No Options available" + } + } + }, + "services": { + "delete_notification": { + "description": "Deletes a Plugwise Notification", + "name": "Delete Plugwise notification" } -} \ No newline at end of file + } +} diff --git a/custom_components/plugwise/translations/nl.json b/custom_components/plugwise/translations/nl.json index 696fd05cc..f447aa3c3 100644 --- a/custom_components/plugwise/translations/nl.json +++ b/custom_components/plugwise/translations/nl.json @@ -1,40 +1,10 @@ { - "options": { - "step": { - "none": { - "title": "Geen Opties beschikbaar", - "description": "Deze Integratie heeft geen Opties" - }, - "init": { - "description": "Smile/Stretch Opties aanpassen", - "data": { - "cooling_on": "Anna: koelmodus is aan", - "scan_interval": "Scan Interval (seconden) *) optie alleen in beta", - "homekit_emulation": "Homekit emulatie (bij hvac_off => Afwezig) *) optie alleen in beta", - "refresh_interval": "Frontend ververs-tijd (1,5 - 5 seconden) *) optie alleen in beta" - } - } - } - }, "config": { - "step": { - "reconfigure": { - "description": "Configuratie bijwerken voor {title}.", - "data": { - "host": "IP-adres", - "port": "Port nummer" - } - }, - "user": { - "title": "Installeer Plugwise Adam/Smile/Stretch", - "description": "Van uw Plugwise apparaat voer in: (installeren kan tot 90s duren)", - "data": { - "password": "ID", - "username": "Gebruikersnaam", - "host": "IP-adres", - "port": "Poortnummer" - } - } + "abort": { + "already_configured": "Dit apparaat is al geconfigureerd", + "anna_with_adam": "Zowel Anna als Adam gedetecteerd. Voeg alleen de Adam toe, niet de Anna", + "not_the_same_smile": "Het ingestelde Smile ID matcht niet met het ID van het ingegeven IP adres.", + "reconfigure_successful": "Herconfigureren gelukt" }, "error": { "cannot_connect": "Verbinden is mislukt", @@ -47,24 +17,37 @@ "unknown": "Onbekende fout!", "unsupported": "Apparaat met onbekende firmware" }, - "abort": { - "already_configured": "Dit apparaat is al geconfigureerd", - "anna_with_adam": "Zowel Anna als Adam gedetecteerd. Voeg alleen de Adam toe, niet de Anna", - "not_the_same_smile": "Het ingestelde Smile ID matcht niet met het ID van het ingegeven IP adres.", - "reconfigure_successful": "Herconfigureren gelukt" + "step": { + "reconfigure": { + "data": { + "host": "IP-adres", + "port": "Poort" + }, + "description": "Configuratie bijwerken voor {title}." + }, + "user": { + "data": { + "host": "IP-adres", + "password": "ID", + "port": "Poort", + "username": "Gebruikersnaam" + }, + "description": "Van uw Plugwise apparaat voer in: (installeren kan tot 90s duren)", + "title": "Installeer Plugwise Adam/Smile/Stretch" + } } }, "entity": { "binary_sensor": { - "low_battery": { - "name": "Batterij status" - }, "compressor_state": { "name": "Compressorstatus" }, "cooling_enabled": { "name": "Koelfunctie aan" }, + "cooling_state": { + "name": "Koelen" + }, "dhw_state": { "name": "Status huishoudelijk warmwater" }, @@ -74,14 +57,19 @@ "heating_state": { "name": "Verwarmen" }, - "cooling_state": { - "name": "Koelen" - }, - "secondary_boiler_state": { - "name": "Status secundaire boiler" + "low_battery": { + "name": "Batterij status" }, "plugwise_notification": { "name": "Plugwise melding" + }, + "secondary_boiler_state": { + "name": "Status secundaire boiler" + } + }, + "button": { + "reboot": { + "name": "Herstart" } }, "climate": { @@ -100,12 +88,12 @@ } }, "number": { - "maximum_boiler_temperature": { - "name": "Maximale cv-ketel temperatuur" - }, "max_dhw_temperature": { "name": "Maximale huishoudelijk warmwatertemperatuur" }, + "maximum_boiler_temperature": { + "name": "Maximale cv-ketel temperatuur" + }, "temperature_offset": { "name": "Temperatuurcompensatie" } @@ -120,6 +108,14 @@ "off": "Uit" } }, + "select_gateway_mode": { + "name": "Gateway mode", + "state": { + "away": "Pauze", + "full": "Normaal", + "vacation": "Vakantie" + } + }, "select_regulation_mode": { "name": "Regelmodus", "state": { @@ -130,14 +126,6 @@ "off": "Uit" } }, - "select_gateway_mode": { - "name": "Gateway mode", - "state": { - "away": "Pauze", - "full": "Normaal", - "vacation": "Vakantie" - } - }, "select_schedule": { "name": "Thermostaatschema", "state": { @@ -154,143 +142,143 @@ } }, "sensor": { - "setpoint": { - "name": "Instelling" - }, "cooling_setpoint": { "name": "Instelling koelen" }, - "heating_setpoint": { - "name": " Instelling verwarmen" - }, - "intended_boiler_temperature": { - "name": "Doeltemperatuur boiler" - }, - "temperature_difference": { - "name": "Temperatuurverschil" - }, - "outdoor_temperature": { - "name": "Buitentemperatuur" - }, - "outdoor_air_temperature": { - "name": "Temperatuur buitenlucht" - }, - "water_temperature": { - "name": "Watertemperatuur" + "dhw_temperature": { + "name": "Huishoudelijk warmwatertemperatuur" }, - "return_temperature": { - "name": "Terugvoertemperatuur" + "domestic_hot_water_setpoint": { + "name": "Instelling huishoudelijk warmwater" }, "electricity_consumed": { "name": "Verbruikte electriciteit" }, - "electricity_produced": { - "name": "Teruggeleverde electriciteit" - }, - "electricity_consumed_point": { - "name": "Electriciteitsgebruik" - }, - "electricity_produced_point": { - "name": "Electriciteitsopwek" - }, "electricity_consumed_interval": { "name": "Electriciteitsgebruik - interval" }, - "electricity_consumed_peak_interval": { - "name": "Electriciteitsgebruik - interval piek" + "electricity_consumed_off_peak_cumulative": { + "name": "Electriciteitsgebruik - cumulatief dal" }, "electricity_consumed_off_peak_interval": { "name": "Electriciteitsgebruik - interval dal" }, - "electricity_produced_interval": { - "name": "Electriciteitsopwek - interval" - }, - "electricity_produced_peak_interval": { - "name": "Electriciteitsopwek - interval piek" - }, - "electricity_produced_off_peak_interval": { - "name": "Electriciteitsopwek - interval dal" - }, "electricity_consumed_off_peak_point": { "name": "Electriciteitsgebruik dal" }, - "electricity_consumed_peak_point": { - "name": "Electriciteitsgebruik piek" - }, - "electricity_consumed_off_peak_cumulative": { - "name": "Electriciteitsgebruik - cumulatief dal" - }, "electricity_consumed_peak_cumulative": { "name": "Electriciteitsgebruik - cumulatief piek" }, - "electricity_produced_off_peak_point": { - "name": "Electriciteitsopwek - dal" - }, - "electricity_produced_peak_point": { - "name": "Electriciteitsopwek - piek" + "electricity_consumed_peak_interval": { + "name": "Electriciteitsgebruik - interval piek" }, - "electricity_produced_off_peak_cumulative": { - "name": "Electriciteitsopwek - cumulatief dal" + "electricity_consumed_peak_point": { + "name": "Electriciteitsgebruik piek" }, - "electricity_produced_peak_cumulative": { - "name": "Electriciteitsopwek - cumulatief piek" + "electricity_consumed_point": { + "name": "Electriciteitsgebruik" }, "electricity_phase_one_consumed": { "name": "Electriciteitsgebruik fase een" }, - "electricity_phase_two_consumed": { - "name": "Electriciteitsgebruik fase twee" + "electricity_phase_one_produced": { + "name": "Electriciteitsopwek fase een" }, "electricity_phase_three_consumed": { "name": "Electriciteitsgebruik fase drie" }, - "electricity_phase_one_produced": { - "name": "Electriciteitsopwek fase een" + "electricity_phase_three_produced": { + "name": "Electriciteitsopwek fase drie" + }, + "electricity_phase_two_consumed": { + "name": "Electriciteitsgebruik fase twee" }, "electricity_phase_two_produced": { "name": "Electriciteitsopwek fase twee" }, - "electricity_phase_three_produced": { - "name": "Electriciteitsopwek fase drie" + "electricity_produced": { + "name": "Teruggeleverde electriciteit" }, - "voltage_phase_one": { - "name": "Netspanning fase een" + "electricity_produced_interval": { + "name": "Electriciteitsopwek - interval" }, - "voltage_phase_two": { - "name": "Netspanning fase twee" + "electricity_produced_off_peak_cumulative": { + "name": "Electriciteitsopwek - cumulatief dal" }, - "voltage_phase_three": { - "name": "Netspanning fase drie" + "electricity_produced_off_peak_interval": { + "name": "Electriciteitsopwek - interval dal" }, - "gas_consumed_interval": { - "name": "Gasverbruik - interval" + "electricity_produced_off_peak_point": { + "name": "Electriciteitsopwek - dal" + }, + "electricity_produced_peak_cumulative": { + "name": "Electriciteitsopwek - cumulatief piek" + }, + "electricity_produced_peak_interval": { + "name": "Electriciteitsopwek - interval piek" + }, + "electricity_produced_peak_point": { + "name": "Electriciteitsopwek - piek" + }, + "electricity_produced_point": { + "name": "Electriciteitsopwek" }, "gas_consumed_cumulative": { "name": "Cumulatief gasverbruik" }, - "net_electricity_point": { - "name": "Netto electriciteitsgebruik" + "gas_consumed_interval": { + "name": "Gasverbruik - interval" }, - "net_electricity_cumulative": { - "name": "Netto cumulatief electriciteitsgebruik" + "heating_setpoint": { + "name": "Instelling verwarmen" + }, + "intended_boiler_temperature": { + "name": "Doeltemperatuur boiler" + }, + "maximum_boiler_temperature": { + "name": "Instelling maximale boilertemperatuur" }, "modulation_level": { "name": "Modulatie" }, + "net_electricity_cumulative": { + "name": "Netto cumulatief electriciteitsgebruik" + }, + "net_electricity_point": { + "name": "Netto electriciteitsgebruik" + }, + "outdoor_air_temperature": { + "name": "Temperatuur buitenlucht" + }, + "outdoor_temperature": { + "name": "Buitentemperatuur" + }, + "return_temperature": { + "name": "Terugvoertemperatuur" + }, + "setpoint": { + "name": "Instelling" + }, + "temperature_difference": { + "name": "Temperatuurverschil" + }, "valve_position": { "name": "Kleppositie" }, - "water_pressure": { - "name": "Waterdruk" + "voltage_phase_one": { + "name": "Netspanning fase een" }, - "dhw_temperature": { - "name": "Huishoudelijk warmwatertemperatuur" + "voltage_phase_three": { + "name": "Netspanning fase drie" }, - "domestic_hot_water_setpoint": { - "name": "Instelling huishoudelijk warmwater" + "voltage_phase_two": { + "name": "Netspanning fase twee" }, - "maximum_boiler_temperature": { - "name": "Instelling maximale boilertemperatuur" + "water_pressure": { + "name": "Waterdruk" + }, + "water_temperature": { + "name": "Watertemperatuur" } }, "switch": { @@ -334,10 +322,27 @@ "message": "Apparaat met niet-ondersteunde firmware" } }, + "options": { + "step": { + "init": { + "data": { + "cooling_on": "Anna: koelmodus is aan", + "homekit_emulation": "Homekit emulatie (bij hvac_off => Afwezig) *) optie alleen in beta", + "refresh_interval": "Frontend ververs-tijd (1,5 - 5 seconden) *) optie alleen in beta", + "scan_interval": "Scan Interval (seconden) *) optie alleen in beta" + }, + "description": "Smile/Stretch Opties aanpassen" + }, + "none": { + "description": "Deze Integratie heeft geen Opties", + "title": "Geen Opties beschikbaar" + } + } + }, "services": { "delete_notification": { - "name": "Verwijder Plugwise notificatie", - "description": "Verwijder een Plugwise notificatie" + "description": "Verwijder een Plugwise notificatie", + "name": "Verwijder Plugwise notificatie" } } } diff --git a/pyproject.toml b/pyproject.toml index 93262f475..36c525f47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -539,8 +539,6 @@ ignore = [ "TRY003", # Avoid specifying long messages outside the exception class "TRY400", # Use `logging.exception` instead of `logging.error` - # Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923 - "UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` # May conflict with the formatter, https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", diff --git a/scripts/core-testing.sh b/scripts/core-testing.sh index 0040b8476..1764c52e2 100755 --- a/scripts/core-testing.sh +++ b/scripts/core-testing.sh @@ -27,6 +27,9 @@ echo -e "${CINFO}Working on HA-core branch ${core_branch}${CNORM}" # If you want full pytest output run as # DEBUG=1 scripts/core-testing.sh +# Ensure ulimit is setup to match core/astral-uv expectations +ulimit -n 65536 + # If you want to test a single file # run as "scripts/core_testing.sh test_config_flow.py" or # "scripts/core_testing.sh test_sensor.py" @@ -37,11 +40,6 @@ echo -e "${CINFO}Working on HA-core branch ${core_branch}${CNORM}" # If you want to prepare for Core PR, run as # "COMMIT_CHECK=true scripts/core_testing.sh" -# Which packages to install (to prevent installing all test requirements) -# actual package version ARE verified (i.e. grepped) from requirements_test_all -# separate packages with | -pip_packages="fnvhash|lru-dict|voluptuous|aiohasupervisor|aiohttp_cors|pyroute2|sqlalchemy|zeroconf|pytest-socket|pre-commit|paho-mqtt|numpy|pydantic|ruff|ffmpeg|hassil|home-assistant-intents|pylint|pylint-per-file-ignores|cronsim" - echo "" echo -e "${CINFO}Checking for necessary tools and preparing setup:${CNORM}" @@ -61,6 +59,21 @@ which jq || ( echo -e "${CFAIL}You should have jq installed, exiting${CNORM}"; e my_path=$(git rev-parse --show-toplevel) +venv_and_uv() { + # shellcheck disable=SC1091 + source venv/bin/activate + if ! [ -x "$(command -v uv)" ]; then + echo -e "${CINFO}Ensure uv presence${CWARN}" + python3 -m pip install uv + fi + if ! uv pip list | grep -q bcrypt; then + script/setup + fi + if ! [ -x "$(command -v pytest)" ]; then + uv pip install pytest + fi +} + # Ensure environment is set-up # 20250613 Copied from HA-core and shell-check adjusted and modified for local use @@ -165,24 +178,14 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "core_prep" ] ; then # Fake branch git checkout -b fake_branch - echo "" - echo -e "${CINFO}Ensure HA-core venv${CWARN}" - if [ -x "$(command -v uv)" ]; then + if [ ! -d "venv" ]; then + echo -e "${CINFO}Ensure HA-core venv${CWARN}" uv venv --seed venv - else - python3 -m venv venv fi + echo -e "${CINFO}(Re)setup HA-core ${CWARN}" + script/setup # shellcheck disable=SC1091 - source venv/bin/activate - - if ! [ -x "$(command -v uv)" ]; then - echo -e "${CINFO}Ensure uv presence${CWARN}" - python3 -m pip install uv - fi - - echo -e "${CINFO}Bootstrap pip parts of HA-core${CWARN}" - sh "${coredir}/script/bootstrap" - uv pip install -e . --config-settings editable_mode=compat --constraint homeassistant/package_constraints.txt + source venv/bin/activate echo "" echo -e "${CINFO}Cleaning existing ${REPO_NAME} from HA core${CNORM}" @@ -194,6 +197,14 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "core_prep" ] ; then cp -r ../custom_components/${REPO_NAME} ./homeassistant/components/ cp -r ../tests/components/${REPO_NAME} ./tests/components/ echo "" + + echo -e "${CINFO}Validating prettierrc changes${CNORM}" + prettierrc=".prettierrc.js" + if ! diff -q <(sed 's/homeassistant/custom_components/g' "${prettierrc}") "../${prettierrc}" >/dev/null; then + echo -e "${CWARN}Updating prettierrc from core${CNORM}" + sed 's/homeassistant/custom_components/g' "${prettierrc}" > "../${prettierrc}" + fi + fi # core_prep set +u @@ -201,28 +212,12 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "pip_prep" ] ; then cd "${coredir}" || exit echo "" echo -e "${CINFO}Ensure HA-core venv${CNORM}" - # shellcheck disable=SC1091 - source venv/bin/activate + venv_and_uv mkdir -p ./tmp echo "" echo -e "${CINFO}Ensure translations are there${CNORM}" echo "" python3 -m script.translations develop --all > /dev/null 2>&1 - echo "" - if ! [ -x "$(command -v uv)" ]; then - echo -e "${CINFO}Ensure uv is there${CNORM}" - python3 -m pip install uv - fi - echo -e "${CINFO}Installing pip modules (using uv)${CNORM}" - echo "" - echo -e "${CINFO} - HA requirements (core and test)${CNORM}" - uv pip install --upgrade -r requirements.txt -r requirements_test.txt - grep -hEi "${pip_packages}" requirements_test_all.txt > ./tmp/requirements_test_extra.txt - echo -e "${CINFO} - extra's required for ${REPO_NAME}${CNORM}" - uv pip install --upgrade -r ./tmp/requirements_test_extra.txt - echo -e "${CINFO} - home assistant basics${CNORM}" - uv pip install -e . --config-settings editable_mode=compat --constraint homeassistant/package_constraints.txt - echo "" # When using test.py prettier makes multi-line, so use jq module=$(jq '.requirements[]' ../custom_components/${REPO_NAME}/manifest.json | tr -d '"') #module=$(grep require ../custom_components/${REPO_NAME}/manifest.json | cut -f 4 -d '"') @@ -236,8 +231,7 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "testing" ] ; then cd "${coredir}" || exit echo "" echo -e "${CINFO}Ensure HA-core venv${CNORM}" - # shellcheck disable=SC1091 - source venv/bin/activate + venv_and_uv echo "" echo -e "${CINFO}Test commencing ...${CNORM}" echo "" @@ -269,8 +263,7 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "quality" ] ; then cd "${coredir}" || exit echo "" echo -e "${CINFO}Ensure HA-core venv${CNORM}" - # shellcheck disable=SC1091 - source venv/bin/activate + venv_and_uv echo "" set +e echo -e "${CINFO}... ruff-ing component...${CNORM}" @@ -293,8 +286,7 @@ if [ -z "${GITHUB_ACTIONS}" ]; then cd "${coredir}" || exit echo "" echo "Ensure HA-core venv${CNORM}" - # shellcheck disable=SC1091 - source venv/bin/activate + venv_and_uv echo "" echo -e "${CINFO}Copy back modified files ...${CNORM}" echo ""