Skip to content

Commit

Permalink
Merge pull request #71 from ha-warmup/dev
Browse files Browse the repository at this point in the history
Releasing v2024.2.7 from dev to master
  • Loading branch information
artmg authored Feb 7, 2024
2 parents a9bcec1 + cd817c5 commit 0a8b63c
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 48 deletions.
43 changes: 40 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,53 @@ Recent features from development that have not been formally released yet:

### Added

* e66cebf Include full documention for HACS installation with images
* 01b4bb7 How to disable actions when they fail in your OWN fork
* 909513e Contributing pre-releases (beta versions)
*

### Changed

*

### Fixed

*

### Documented

*

### Deprecated

*

### Removed

*


## 2024.2.7 Pre-release

Prepare for HA Core 2025.1 release, by moving deprecated Contants to Enums. Triggered by HA Core 2023.12 release logging deprecation warnings on startup.

### Added

*

### Changed

*

### Fixed

* 38ef7ae Updated to use new ENUM constants instead of deprecated ones (Issue #65)
*

### Documented

* d743cb6 more testing methods in CONTRIBUTING.md
* 0677520 minor doc link for installation types
* e66cebf Include full documention for HACS installation with images
* 01b4bb7 How to disable actions when they fail in your OWN fork
* 909513e Contributing pre-releases (beta versions)
*

### Deprecated
Expand Down
67 changes: 51 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,71 @@

Thank you for your interest in helping out with this project.

Two very straighforward ways of getting involved on your own terms are:
In ascending order of complexity, here are ways you can get involved with this project:

* Issues
* looking at [issues raised](https://github.com/ha-warmup/warmup/issues) and trying to advise users looking for help, or encouraging them to obtain useful diagnostics
* Documentation
* increasing the detail, accuracy or readability in our [documentation wiki](https://github.com/ha-warmup/warmup/wiki)
* increasing the detail, accuracy or readability in:
* our [documentation wiki](https://github.com/ha-warmup/warmup/wiki) (which you can edit directly) or
* any of the readme files accompanying the code (which will require a pull request)
* Testing
* when candidate fixes are posted against issues, you can load the modified code yourself and give it a go, to see if it works well under your own circumstances
* Coding (Development)
* modifying the programme source code or configuration defaults in order to rectify reported issues, or to work on new features

Otherwise, if you are willing to help us test new features,
## Testing

## Beta

If you are willing to help us test new features,
before they are put on general release,
you can set your HACS Integration (re-)download settings
to `show beta versions`.

![download-show-beta](docs/images/download-show-beta.png)

If you want to take things further you can get involved with code,
either to deal with issues raised or to develop new features.
Please report any failure with specific messages or circumstance, in the relevant issue ticket. If you get none, then please report your success, so that we know we are closer to promoting the fix towards the main live release.

## Alpha testing

If you are suffering with a specific issue yourself, or are just happy to get involved in earlier testing, you can obtain earlier releases of code in different ways, depending on your setup.

Let's suppose that someone has submitted a Pull Request (PR) for a branch called `fix232_v2`, here are a couple of methods.

#### Alternative manual install

If you installed your set up manually, you can use the [alternative manual install method](https://github.com/ha-warmup/warmup?tab=readme-ov-file#alternative-versions) specifying the branch, e.g.

```
git clone -b fix232_v2 https://github.com/ha-warmup/warmup.git /tmp/warmup
```

#### HACS install.service

You can install a specific branch on HASOS / HACS by calling the update.install service

```
service: update.install
data:
version: fix232_v2
target:
entity_id: update.warmup_under_floor_heating_integration_update
```

## Development

### Project Structure

For the time being, contributors have settled on a
[project structure](https://github.com/ha-warmup/warmup/issues/50)
that includes:

* HACS integration as a custom repository, with associated metadata files
* Instructions for manual install as custom_component
* incorporating any changes to the API-related python code in warmup4ie subfolder
* and keeping a tracking copy in the root warmup4ie-PyPi folder for later

### Forking

As you will use a fork for your development we encourage you to
Expand Down Expand Up @@ -54,17 +100,6 @@ to work on your local project repository.

Please raise an issue if you want further guidance on developing new features or fixing issues.

### Project Structure

For the time being, contributors have settled on a
[project structure](https://github.com/ha-warmup/warmup/issues/50)
that includes:

* HACS integration as a custom repository, with associated metadata files
* Instructions for manual install as custom_component
* incorporating any changes to the API-related python code in warmup4ie subfolder
* and keeping a tracking copy in the root warmup4ie-PyPi folder for later

### Pull Requests

Once you have completed your development and testing on your changes,
Expand Down
51 changes: 23 additions & 28 deletions custom_components/warmup/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,20 @@

from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF,
HVAC_MODE_AUTO,
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
HVACAction,
HVACMode,
PRESET_AWAY,
PRESET_BOOST,
PRESET_HOME,
SUPPORT_PRESET_MODE,
SUPPORT_TARGET_TEMPERATURE,
ClimateEntityFeature,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_TEMPERATURE,
CONF_PASSWORD,
CONF_USERNAME,
PRECISION_HALVES,
TEMP_CELSIUS,
UnitOfTemperature,
)
from homeassistant.exceptions import InvalidStateError, PlatformNotReady
import homeassistant.helpers.config_validation as cv
Expand Down Expand Up @@ -65,15 +60,15 @@
CONST_MODE_OFF = "off" # Switch off heating in a zone

HVAC_MAP_WARMUP_HEAT = {
CONST_MODE_PROGRAM: HVAC_MODE_AUTO,
CONST_MODE_FIXED: HVAC_MODE_HEAT,
CONST_MODE_AWAY: HVAC_MODE_AUTO,
CONST_MODE_FROST: HVAC_MODE_HEAT,
CONST_MODE_OFF: HVAC_MODE_OFF,
CONST_MODE_PROGRAM: HVACMode.AUTO,
CONST_MODE_FIXED: HVACMode.HEAT,
CONST_MODE_AWAY: HVACMode.AUTO,
CONST_MODE_FROST: HVACMode.HEAT,
CONST_MODE_OFF: HVACMode.OFF,
}

SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_PRESET_MODE
SUPPORT_HVAC_HEAT = [HVAC_MODE_HEAT, HVAC_MODE_AUTO, HVAC_MODE_OFF]
SUPPORT_FLAGS = ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE
SUPPORT_HVAC_HEAT = [HVACMode.HEAT, HVACMode.AUTO, HVACMode.OFF]
SUPPORT_PRESET = [PRESET_AWAY, PRESET_HOME, PRESET_BOOST]

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
Expand Down Expand Up @@ -176,21 +171,21 @@ def target_temperature(self):
def hvac_mode(self):
"""Return hvac operation ie. heat, cool mode.
Need to be one of HVAC_MODE_*.
Need to be one of HVACMode.
"""
return HVAC_MAP_WARMUP_HEAT.get(self._current_operation_mode, HVAC_MODE_AUTO)
return HVAC_MAP_WARMUP_HEAT.get(self._current_operation_mode, HVACMode.AUTO)

@property
def hvac_action(self):
"""Return the current running hvac operation if supported.
Need to be one of CURRENT_HVAC_*.
Need to be one of HVACAction.
"""
if not self._on:
return CURRENT_HVAC_OFF
return HVACAction.OFF
if not self._away:
return CURRENT_HVAC_HEAT
return CURRENT_HVAC_IDLE
return HVACAction.HEATING
return HVACAction.IDLE

@property
def preset_mode(self):
Expand Down Expand Up @@ -237,17 +232,17 @@ def set_hvac_mode(self, hvac_mode):
Switch device on if was previously off
"""

if hvac_mode == HVAC_MODE_OFF:
if hvac_mode == HVACMode.OFF:
self._on = False
self._device.set_location_to_off()
self._current_operation_mode = CONST_MODE_OFF

elif hvac_mode == HVAC_MODE_AUTO:
elif hvac_mode == HVACMode.AUTO:
self._on = True
self._device.set_temperature_to_auto()
self._current_operation_mode = CONST_MODE_PROGRAM

elif hvac_mode == HVAC_MODE_HEAT:
elif hvac_mode == HVACMode.HEAT:
self._on = True
self._device.set_temperature_to_manual()
self._current_operation_mode = CONST_MODE_FIXED
Expand Down Expand Up @@ -316,15 +311,15 @@ def state_attributes(self) -> Dict[str, Any]:
def min_temp(self):
"""Return the minimum temperature."""
# return convert_temperature(
# self._device.min_temp, TEMP_CELSIUS, self.hass.config.units.temperature_unit
# self._device.min_temp, UnitOfTemperature.CELSIUS, self.hass.config.units.temperature_unit
# )
return self._device.min_temp

@property
def max_temp(self):
"""Return the maximum temperature."""
# return convert_temperature(
# self._device.max_temp, TEMP_CELSIUS, self.hass.config.units.temperature_unit
# self._device.max_temp, UnitOfTemperature.CELSIUS, self.hass.config.units.temperature_unit
# )
return self._device.max_temp

Expand All @@ -341,7 +336,7 @@ def should_poll(self):
@property
def temperature_unit(self):
"""Return the unit of measurement."""
return TEMP_CELSIUS
return UnitOfTemperature.CELSIUS

@property
def target_temperature_step(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/warmup/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/ha-warmup/warmup/issues/",
"requirements": [],
"version": "2023.3.27"
"version": "2024.2.7"
}
1 change: 1 addition & 0 deletions docs/install-in-HACS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This assumes you have already installed the Home Assistant Community Store follo

https://hacs.xyz/docs/setup/prerequisites

If you want other kinds if installation, please see [README](../README.md).

## Default installation

Expand Down

0 comments on commit 0a8b63c

Please sign in to comment.