Upgrade greeneye_monitor to 1.0 (#19631)

* Upgrade greeneye_monitor to 1.0

This is a breaking change; it causes the `serial_number` field in
configuration to be treated as the full 8-digit serial number rather
than the last 5 digits as was previously done, which results in the unique
identifiers for the sensors being different. (Fixing them up in
`config/.storage/core.entity_registry` before rebooting into the updated
version seems to prevent any weirdness.)

The last-5-digits behavior was a result of me misunderstanding the packet
format docs and not realizing that the true serial number was split across
two fields. In addition to being confusing (see
https://community.home-assistant.io/t/brultech-greeneye-issues/86852), it
was technically incorrect. The `greeneye_monitor` platform was just introduced
in 0.82, so it seems like the kind of thing that's best to fix now while
adoption is relatively low rather than later when somebody runs into it
as more than just a point of confusion.

* Switch to 8-character string

* Coerce to int

* Remove now-unnecessary cast
This commit is contained in:
Jonathan Keljo 2019-01-11 20:54:22 -08:00 committed by Paulus Schoutsen
parent b3580f46b9
commit 6395087a40
2 changed files with 11 additions and 3 deletions

View file

@ -16,7 +16,7 @@ from homeassistant.const import (
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import async_load_platform
REQUIREMENTS = ['greeneye_monitor==0.1']
REQUIREMENTS = ['greeneye_monitor==1.0']
_LOGGER = logging.getLogger(__name__)
@ -81,7 +81,15 @@ CHANNEL_SCHEMA = vol.Schema({
CHANNELS_SCHEMA = vol.All(cv.ensure_list, [CHANNEL_SCHEMA])
MONITOR_SCHEMA = vol.Schema({
vol.Required(CONF_SERIAL_NUMBER): cv.positive_int,
vol.Required(CONF_SERIAL_NUMBER):
vol.All(
cv.string,
vol.Length(
min=8,
max=8,
msg="GEM serial number must be specified as an 8-character "
"string (including leading zeroes)."),
vol.Coerce(int)),
vol.Optional(CONF_CHANNELS, default=[]): CHANNELS_SCHEMA,
vol.Optional(
CONF_TEMPERATURE_SENSORS,

View file

@ -466,7 +466,7 @@ googlemaps==2.5.1
gps3==0.33.3
# homeassistant.components.greeneye_monitor
greeneye_monitor==0.1
greeneye_monitor==1.0
# homeassistant.components.light.greenwave
greenwavereality==0.5.1