From 60f692c7bbd7282678a10ee6e9c4f02e2e174002 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Thu, 31 May 2018 10:55:50 -0600 Subject: [PATCH] Fixes (and stabilizes) some incorrect zone codes in RainMachine (#14719) * Fixes (and stabilizes) some incorrect zone codes * Fixed a misspelling --- .../components/switch/rainmachine.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/switch/rainmachine.py b/homeassistant/components/switch/rainmachine.py index f4b2d780a9a..bdee64a3d54 100644 --- a/homeassistant/components/switch/rainmachine.py +++ b/homeassistant/components/switch/rainmachine.py @@ -83,7 +83,7 @@ SPRINKLER_TYPE_MAP = { 1: 'Popup Spray', 2: 'Rotors', 3: 'Surface Drip', - 4: 'Bubblers', + 4: 'Bubblers Drip', 99: 'Other' } @@ -96,14 +96,14 @@ SUN_EXPOSURE_MAP = { VEGETATION_MAP = { 0: 'Not Set', - 1: 'Not Set', - 2: 'Grass', + 2: 'Cool Season Grass', 3: 'Fruit Trees', 4: 'Flowers', 5: 'Vegetables', 6: 'Citrus', - 7: 'Bushes', - 8: 'Xeriscape', + 7: 'Trees and Bushes', + 9: 'Drought Tolerant Plants', + 10: 'Warm Season Grass', 99: 'Other' } @@ -296,15 +296,17 @@ class RainMachineZone(RainMachineSwitch): self._properties_json.get( 'waterSense').get('precipitationRate'), ATTR_RESTRICTIONS: self._obj.get('restriction'), - ATTR_SLOPE: SLOPE_TYPE_MAP[self._properties_json.get('slope')], + ATTR_SLOPE: SLOPE_TYPE_MAP.get( + self._properties_json.get('slope')), ATTR_SOIL_TYPE: - SOIL_TYPE_MAP[self._properties_json.get('sun')], + SOIL_TYPE_MAP.get(self._properties_json.get('sun')), ATTR_SPRINKLER_TYPE: - SPRINKLER_TYPE_MAP[self._properties_json.get('group_id')], + SPRINKLER_TYPE_MAP.get( + self._properties_json.get('group_id')), ATTR_SUN_EXPOSURE: - SUN_EXPOSURE_MAP[self._properties_json.get('sun')], + SUN_EXPOSURE_MAP.get(self._properties_json.get('sun')), ATTR_VEGETATION_TYPE: - VEGETATION_MAP[self._obj.get('type')], + VEGETATION_MAP.get(self._obj.get('type')), }) except RainMachineError as exc_info: _LOGGER.error('Unable to update info for zone "%s"',