Skip to content

Commit

Permalink
0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hakana committed Sep 8, 2020
1 parent 346d918 commit 83da341
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions custom_components/shelly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

_LOGGER = logging.getLogger(__name__)

__version__ = "0.2.0-b7"
__version__ = "0.2.0"
VERSION = __version__

async def async_setup(hass, config):
Expand Down Expand Up @@ -376,7 +376,8 @@ async def _async_block_updated(self, block):
self.add_device("switch", attr)
elif update_switch is not None:
update_switch.remove()


if hass_data['allow_upgrade_beta_switch']:
has_beta_update = block.has_fw_update(True)
update_beta_switch = getattr(block, 'beta_firmware_switch', None)
if has_beta_update:
Expand Down Expand Up @@ -416,6 +417,8 @@ async def _async_block_added(self, block):
block.hass_data = {
'allow_upgrade_switch' :
self._get_specific_config_root(CONF_UPGRADE_SWITCH, block.id),
'allow_upgrade_beta_switch' :
self._get_specific_config_root(CONF_UPGRADE_BETA_SWITCH, block.id),
'sensor_cfg' : self._get_sensor_config(block.id),
'discover': discover_block
}
Expand Down
1 change: 0 additions & 1 deletion custom_components/shelly/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def update(self):
if self._click_timer is not None:
self._click_timer.cancel()
diff = millis - self._last_state_change
print(diff)
if diff < self._click_delay or self._click_cnt == 0:
self._click_cnt += 1
else:
Expand Down
2 changes: 2 additions & 0 deletions custom_components/shelly/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ALL_ATTRIBUTES, CONF_ATTRIBUTES,
ALL_SENSORS, CONF_SENSORS,
CONF_MDNS, CONF_VERSION, CONF_UPGRADE_SWITCH,
CONF_UPGRADE_BETA_SWITCH,
CONF_IGMPFIX, CONF_HOST_IP, CONF_MQTT_PORT,
CONF_CLOUD_AUTH_KEY, CONF_CLOUD_SERVER,
CONF_TMPL_NAME, CONF_ADDITIONAL_INFO,
Expand Down Expand Up @@ -117,6 +118,7 @@ async def async_step_config_1(self, user_input=None):
self.v(CONF_MDNS): bool,
self.v(CONF_VERSION): bool,
self.v(CONF_UPGRADE_SWITCH): bool,
self.v(CONF_UPGRADE_BETA_SWITCH): bool,
self.v(CONF_IGMPFIX): bool,
self.v(CONF_HOST_IP) : str,
self.v(CONF_MQTT_PORT) : int
Expand Down
2 changes: 2 additions & 0 deletions custom_components/shelly/configuration_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
vol.Optional(CONF_SENSORS):
vol.All(cv.ensure_list, [vol.In(ALL_SENSORS_W_EXTRA)]),
vol.Optional(CONF_UPGRADE_SWITCH): cv.boolean,
vol.Optional(CONF_UPGRADE_BETA_SWITCH): cv.boolean,
vol.Optional(CONF_UNAVALABLE_AFTER_SEC) : cv.positive_int,
vol.Optional(CONF_ENTITY_ID): cv.string,
vol.Optional(CONF_POWER_DECIMALS): cv.positive_int, #deprecated
Expand Down Expand Up @@ -70,6 +71,7 @@
vol.Optional(CONF_WIFI_SENSOR): cv.boolean, #deprecated
vol.Optional(CONF_UPTIME_SENSOR): cv.boolean, #deprecated
vol.Optional(CONF_UPGRADE_SWITCH, default=True): cv.boolean,
vol.Optional(CONF_UPGRADE_BETA_SWITCH, default=False): cv.boolean,
vol.Optional(CONF_UNAVALABLE_AFTER_SEC, default=90) : cv.positive_int,
vol.Optional(CONF_SENSORS, default=DEFAULT_SENSORS):
vol.All(cv.ensure_list, [vol.In(ALL_SENSORS_W_EXTRA)]),
Expand Down
1 change: 1 addition & 0 deletions custom_components/shelly/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CONF_POWER_DECIMALS = 'power_decimals'
CONF_SENSORS = 'sensors'
CONF_UPGRADE_SWITCH = 'upgrade_switch'
CONF_UPGRADE_BETA_SWITCH = 'upgrade_beta_switch'
CONF_UNAVALABLE_AFTER_SEC = 'unavailable_after_sec'
CONF_CLOUD_AUTH_KEY = 'cloud_auth_key'
CONF_CLOUD_SERVER = 'cloud_server'
Expand Down

0 comments on commit 83da341

Please sign in to comment.