Skip to content

Commit

Permalink
Remove cruft
Browse files Browse the repository at this point in the history
sebr committed May 17, 2022
1 parent 09d157f commit 992bec6
Showing 4 changed files with 4 additions and 61 deletions.
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -40,20 +40,7 @@ Recommended installation is via HACS.

## Configuration

```yaml
bhyve:
username: !secret bhyve_username
password: !secret bhyve_password

sensor:
- platform: bhyve

switch:
- platform: bhyve

binary_sensor:
- platform: bhyve
```
This integration should be configured from the Home Assistant devices & services UI page.

## Sensor Entities

18 changes: 3 additions & 15 deletions custom_components/bhyve/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -32,19 +32,6 @@ async def async_setup_entry(
async_add_entities(sensors, True)


# async def async_setup_platform(hass, config, async_add_entities, _discovery_info=None):
# """Set up BHyve sensors based on a config entry."""
# bhyve = hass.data[DATA_BHYVE]

# sensors = []
# devices = await bhyve.devices
# for device in devices:
# if device.get("type") == DEVICE_FLOOD:
# sensors.append(BHyveFloodSensor(hass, bhyve, device))

# async_add_entities(sensors, True)


class BHyveFloodSensor(BHyveDeviceEntity):
"""Define a BHyve sensor."""

@@ -70,11 +57,12 @@ def _setup(self, device):
)

def _parse_status(self, status):
"""Convert BHyve alarm status to entity value."""
return "on" if status.get("flood_alarm_status") == "alarm" else "off"

@property
def state(self):
"""Return the state of the entity"""
"""Return the state of the entity."""
return self._state

@property
@@ -84,7 +72,7 @@ def unique_id(self):

@property
def is_on(self):
"""Reports state of the flood sensor"""
"""Reports state of the flood sensor."""
return self._state == "on"

def _on_ws_data(self, data):
11 changes: 0 additions & 11 deletions custom_components/bhyve/config_flow.py
Original file line number Diff line number Diff line change
@@ -67,17 +67,6 @@ async def async_step_user(
self.devices = await self.client.devices # type: ignore[union-attr]
self.programs = await self.client.timer_programs # type: ignore[union-attr]

if len(self.devices) == 1:
return self.async_create_entry(
title=self.data[CONF_USERNAME],
data=self.data,
options={
DEVICES: [str(self.devices[0]["id"])],
PROGRAMS: self.programs,
},
)

# Account has more than one device, select devices to add
return await self.async_step_device()

return self.async_show_form(
21 changes: 0 additions & 21 deletions custom_components/bhyve/sensor.py
Original file line number Diff line number Diff line change
@@ -63,27 +63,6 @@ async def async_setup_entry(
async_add_entities(sensors)


# async def async_setup_platform(hass, config, async_add_entities, _discovery_info=None):
# """Set up BHyve sensors based on a config entry."""
# bhyve = hass.data[DATA_BHYVE]

# sensors = []
# devices = await bhyve.devices
# for device in devices:
# if device.get("type") == DEVICE_SPRINKLER:
# sensors.append(BHyveStateSensor(hass, bhyve, device))
# for zone in device.get("zones"):
# sensors.append(BHyveZoneHistorySensor(hass, bhyve, device, zone))

# if device.get("battery", None) is not None:
# sensors.append(BHyveBatterySensor(hass, bhyve, device))
# if device.get("type") == DEVICE_FLOOD:
# sensors.append(BHyveTemperatureSensor(hass, bhyve, device))
# sensors.append(BHyveBatterySensor(hass, bhyve, device))

# async_add_entities(sensors, True)


class BHyveBatterySensor(BHyveDeviceEntity):
"""Define a BHyve sensor."""

0 comments on commit 992bec6

Please sign in to comment.