Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…on-lights into develop
  • Loading branch information
Daniel Mason committed Oct 5, 2019
2 parents 147cd7f + 5eca0e3 commit 125d07c
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 59 deletions.
17 changes: 6 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,24 @@ about: Create a report to help us improve

---

Before opening a new issue, please take a moment to review our [**community guidelines**](https://github.com/react-boilerplate/react-boilerplate/blob/master/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved.
Before opening a new issue, please read the documentation and search for keywords relating to your problem.

## Description
A clear and concise description of what the bug is.

## Configuration
Include configuration of affected entity.

## Logs
Provide logs in DEBUG level.
## Steps to reproduce
Steps to reproduce the behavior:

(Add link to a demo on https://jsfiddle.net or similar if possible)

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.
**Actual Behaviour**

## Versions
## Logs
Provide logs in DEBUG level.

- React-Boilerplate:
- Node/NPM:
- Browser:
## Version
If you are not using the latest version, please upgrade first.
4 changes: 2 additions & 2 deletions .github/issue-close-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ issueConfigs:

- content:
- Description
- Steps to reproduce
- Versions
- Configuration
- Steps to reproduce
- Logs
- Version

- content:
- Is your feature request related to a problem
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="4.0.4"></a>
## [4.0.4](https://gitlab.danielha.tk/HA/appdaemon-motion-lights/compare/v4.0.3...v4.0.4) (2019-09-14)



<a name="4.0.3"></a>
## [4.0.3](https://gitlab.danielha.tk/HA/appdaemon-motion-lights/compare/v4.0.2...v4.0.3) (2019-08-13)

Expand Down
25 changes: 11 additions & 14 deletions custom_components/entity_controller/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Entity controller component for Home Assistant.
Maintainer: Daniel Mason
Version: v4.0.3
Version: v4.0.4
Documentation: https://github.com/danobot/entity-controller
Issues Tracker: Report issues on Github. Ensure you have the latest version. Include:
* YAML configuration (for the misbehaving entity)
Expand Down Expand Up @@ -31,7 +31,7 @@
CONSTRAIN_START = 1
CONSTRAIN_END = 2

VERSION = '4.0.3'
VERSION = '4.0.4'
SENSOR_TYPE_DURATION = 'duration'
SENSOR_TYPE_EVENT = 'event'
MODE_DAY = 'day'
Expand Down Expand Up @@ -73,7 +73,7 @@
vol.Optional(CONF_DELAY, default=DEFAULT_DELAY): cv.positive_int
})

ENTITY_SCHEMA = vol.Schema(cv.has_at_least_one_key(CONF_CONTROL_ENTITIES,
ENTITY_SCHEMA = vol.Schema(cv.has_at_least_one_key(CONF_CONTROL_ENTITIES,
CONF_CONTROL_ENTITY, CONF_TRIGGER_ON_ACTIVATE), {
# vol.Required(CONF_NAME): cv.string,
vol.Optional(CONF_DELAY, default=DEFAULT_DELAY): cv.positive_int,
Expand All @@ -93,7 +93,7 @@
vol.Optional(CONF_NIGHT_MODE, default=None): MODE_SCHEMA,
vol.Optional(CONF_SERVICE_DATA, default=None): vol.Coerce(dict), # Default must be none because we differentiate between set and unset
vol.Optional(CONF_SERVICE_DATA_OFF, default=None): vol.Coerce(dict)

}, extra=vol.ALLOW_EXTRA)

PLATFORM_SCHEMA = cv.schema_with_slug_keys(ENTITY_SCHEMA)
Expand Down Expand Up @@ -171,11 +171,11 @@ async def async_setup(hass, config):
# Constrained
machine.add_transition(trigger='enable', source='constrained', dest='idle', conditions=['is_override_state_off'])
machine.add_transition(trigger='enable', source='constrained', dest='overridden', conditions=['is_override_state_on'])

for key, config in myconfig.items():
if not config:
config = {}

_LOGGER.info("Config Item %s: %s", str(key), str(config))
config["name"] = key
m = None
Expand Down Expand Up @@ -371,7 +371,6 @@ def sensor_state_change(self, entity, old, new):
self.SENSOR_OFF_STATE) and self.is_duration_sensor() and self.is_active_timer():
self.update(last_triggered_by=entity,
sensor_turned_off_at=datetime.now())


# If configured, reset timer when duration sensor goes off
if self.config[CONF_SENSOR_RESETS_TIMER]:
Expand Down Expand Up @@ -602,9 +601,8 @@ def on_exit_blocked(self):
# =====================================================

def config_control_entities(self, config):

self.controlEntities = []

self.add(self.controlEntities, config, CONF_CONTROL_ENTITY)
self.add(self.controlEntities, config, CONF_CONTROL_ENTITIES)

Expand Down Expand Up @@ -789,9 +787,9 @@ def config_other(self, config):
# self.entityOff = config.get(CONF_TRIGGER_ON_DEACTIVATE)
# if CONF_TRIGGER_ON_ACTIVATE in config:
# self.entityOn = config.get(CONF_TRIGGER_ON_ACTIVATE)

self.config[CONF_SENSOR_RESETS_TIMER] = config.get(CONF_SENSOR_RESETS_TIMER)

self.block_timeout = config.get(CONF_BLOCK_TIMEOUT, None)
self.image_prefix = config.get('image_prefix', '/fsm_diagram_')
self.image_path = config.get('image_path', '/conf/temp')
Expand All @@ -813,7 +811,7 @@ def config_other(self, config):

if CONF_SENSOR_TYPE in config:
self.sensor_type = config.get(CONF_SENSOR_TYPE)

self.update(sensor_type=self.sensor_type)

# =====================================================
Expand Down Expand Up @@ -913,14 +911,13 @@ def turn_off_control_entities(self):
self.turn_off_special_entities()
for e in self.controlEntities:
self.log.debug("Turning off %s", e)

if self.lightParams.get(CONF_SERVICE_DATA_OFF) is not None:
self.call_service(e, 'turn_off',
**self.lightParams.get(CONF_SERVICE_DATA_OFF))
else:
self.call_service(e, 'turn_off')


def now_is_between(self, start_time_str, end_time_str, name=None):
start_time = (self._parse_time(start_time_str, name))["datetime"]
end_time = (self._parse_time(end_time_str, name))["datetime"]
Expand Down
57 changes: 27 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "entity-timer",
"version": "4.0.3",
"version": "4.0.4",
"description": "This implementation of motion activated lighting implements a finite state machine to ensure that `MotionLight`s do not interfere with the rest of your home automation setup.",
"main": "index.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion tracker.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"entity_controller": {
"version": "4.0.3",
"version": "4.0.4",
"local_location": "/custom_components/entity_controller/__init__.py",
"remote_location": "https://raw.githubusercontent.com/danobot/entity-controller/master/custom_components/entity_controller/__init__.py",
"visit_repo": "https://github.com/danobot/entity-controller",
Expand Down

0 comments on commit 125d07c

Please sign in to comment.