Skip to content

Commit

Permalink
Fix ImportError from 0.110 (#17)
Browse files Browse the repository at this point in the history
Remove HACS instructions.
  • Loading branch information
pnbruckner authored May 15, 2020
1 parent 6ed28cb commit 407154a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

Creates sensors that provide information about various sun related events.

## Installation

Follow either the HACS or manual installation instructions below.
Follow the installation instructions below.
Then add the desired configuration. Here is an example of a typical configuration:
```yaml
sensor:
Expand All @@ -18,13 +16,9 @@ binary_sensor:
- elevation
```
### HACS
See [HACS](https://github.com/custom-components/hacs).
### Manual
## Installation
Alternatively, place a copy of:
Place a copy of:
[`__init__.py`](custom_components/sun2/__init__.py) at `<config>/custom_components/sun2/__init__.py`
[`binary_sensor.py`](custom_components/sun2/binary_sensor.py) at `<config>/custom_components/sun2/binary_sensor.py`
Expand Down
10 changes: 7 additions & 3 deletions custom_components/sun2/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

import voluptuous as vol

from homeassistant.components.binary_sensor import (
BinarySensorDevice, PLATFORM_SCHEMA)
try:
from homeassistant.components.binary_sensor import BinarySensorEntity
except ImportError:
from homeassistant.components.binary_sensor import BinarySensorDevice
BinarySensorEntity = BinarySensorDevice
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_ABOVE, CONF_ELEVATION, CONF_MONITORED_CONDITIONS, CONF_NAME)
from homeassistant.core import callback
Expand Down Expand Up @@ -92,7 +96,7 @@ def _val_cfg(config):
})


class Sun2ElevationSensor(BinarySensorDevice):
class Sun2ElevationSensor(BinarySensorEntity):
"""Sun2 Elevation Sensor."""

def __init__(self, hass, name, above):
Expand Down

0 comments on commit 407154a

Please sign in to comment.