Skip to content

Commit

Permalink
Remove switch
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Mar 9, 2019
1 parent 20a3669 commit bac1074
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Platform | Description
-- | --
`binary_sensor` | Show something `True` or `False`
`sensor` | Show info from blueprint API.
`switch`| Switchable device.

![example][exampleimg]

Expand All @@ -49,7 +48,6 @@ custom_components/blueprint/__init__.py
custom_components/blueprint/binary_sensor.py
custom_components/blueprint/const.py
custom_components/blueprint/sensor.py
custom_components/blueprint/sensor.py
```

## Example configuration.yaml
Expand All @@ -62,9 +60,6 @@ blueprint:
sensor:
- enabled: true
name: My custom name
switch:
- enabled: true
name: My custom name
```
## Configuration options
Expand All @@ -73,8 +68,6 @@ Key | Type | Required | Description
-- | -- | -- | --
`binary_sensor` | `list` | `False` | Configuration for the `binary_sensor` platform.
`sensor` | `list` | `False` | Configuration for the `sensor` platform.
`switch` | `list` | `False` | Configuration for the `switch` platform.


### Configuration options for `binary_sensor` list

Expand All @@ -90,14 +83,6 @@ Key | Type | Required | Default | Description
`enabled` | `boolean` | `False` | `False` | Boolean to enable/disable the platform.
`name` | `string` | `False` | `blueprint` | Custom name for the entity.

### Configuration options for `switch` list

Key | Type | Required | Default | Description
-- | -- | -- | -- | --
`enabled` | `boolean` | `False` | `False` | Boolean to enable/disable the platform.
`name` | `string` | `False` | `blueprint` | Custom name for the entity.


***

[exampleimg]: example.png
Expand Down
10 changes: 2 additions & 8 deletions custom_components/blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from homeassistant.util import Throttle
from .const import (
DOMAIN_DATA, DOMAIN, ISSUE_URL, PLATFORMS, REQUIRED_FILES, STARTUP, URL,
VERSION, CONF_BINARY_SENSOR, CONF_SENSOR, CONF_SWITCH, CONF_ENABLED,
CONF_NAME, DEAFULT_NAME)
VERSION, CONF_BINARY_SENSOR, CONF_SENSOR, CONF_ENABLED, CONF_NAME,
DEAFULT_NAME)

MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=30)

Expand All @@ -31,17 +31,11 @@
vol.Optional(CONF_NAME, default=DEAFULT_NAME): cv.string,
})

SWITCH_SCHEMA = vol.Schema({
vol.Optional(CONF_ENABLED, default=False): cv.boolean,
vol.Optional(CONF_NAME, default=DEAFULT_NAME): cv.string,
})

CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Optional(CONF_BINARY_SENSOR): vol.All(
cv.ensure_list, [BINARY_SENSOR_SCHEMA]),
vol.Optional(CONF_SENSOR): vol.All(cv.ensure_list, [SENSOR_SCHEMA]),
vol.Optional(CONF_SWITCH): vol.All(cv.ensure_list, [SWITCH_SCHEMA]),
}),
}, extra=vol.ALLOW_EXTRA)

Expand Down
2 changes: 0 additions & 2 deletions custom_components/blueprint/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
# Configuration
CONF_BINARY_SENSOR = 'binary_sensor'
CONF_SENSOR = 'sensor'
CONF_SWITCH = 'switch'
CONF_ENABLED = 'enabled'
CONF_NAME = 'name'


# Defaults
DEAFULT_NAME = DOMAIN

0 comments on commit bac1074

Please sign in to comment.