-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
284 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from homeassistant.const import TEMP_CELSIUS | ||
from homeassistant.helpers.entity import Entity | ||
from . import IndegoAPI_Instance as API, CONF_MOWER_NAME, DOMAIN | ||
import logging | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
def setup_platform(hass, config, add_devices, discovery_info=None): | ||
"""Setup the binary sensor platform.""" | ||
_LOGGER.debug("Setup Binary Sensor Platform") | ||
|
||
update_available_sensor_name = CONF_MOWER_NAME + ' update available' | ||
add_devices([IndegoUpdateAvailable(update_available_sensor_name)]) | ||
|
||
_LOGGER.debug("Finished Binary Sensor Platform setup!") | ||
|
||
class IndegoUpdateAvailable(Entity): | ||
"""Indego Update Available Sensor.""" | ||
|
||
def __init__(self, device_label): | ||
"""Initialize Update Avaliable sensor""" | ||
self._state = None | ||
self._device_label = device_label | ||
|
||
@property | ||
def name(self): | ||
"""Return the name of the sensor.""" | ||
return self._device_label | ||
|
||
@property | ||
def state(self): | ||
"""Return the user adjustment.""" | ||
return self._state | ||
|
||
@property | ||
def is_on(self): | ||
"""Return if entity is on.""" | ||
return self._state | ||
|
||
@property | ||
def icon(self): | ||
"""Return the icon for the frontend based on the status.""" | ||
tmp_icon = 'mdi:check-decagram' | ||
#if self._state: | ||
# if self._state = '1': | ||
# tmp_icon = 'mdi:alert-decagram' | ||
#else: | ||
# tmp_icon = 'mdi:check-decagram' | ||
return tmp_icon | ||
|
||
def update(self): | ||
"""Fetch firmware sensor.""" | ||
_LOGGER.debug("Update Firmware Available Sensor") | ||
tmp_mode = API.getUpdateAvailable() | ||
_LOGGER.debug(f"Update available = {tmp_mode}") | ||
self._state = tmp_mode | ||
#self._state = 'True' | ||
_LOGGER.debug("Finished update available sensor") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.