Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
2d88f477
Commit
2d88f477
authored
6 years ago
by
Fabian Affolter
Committed by
Daniel Høyer Iversen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Upgrade gitterpy to 0.1.7 (#14643)
parent
5acfe5da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/sensor/gitter.py
+12
-5
12 additions, 5 deletions
homeassistant/components/sensor/gitter.py
requirements_all.txt
+1
-1
1 addition, 1 deletion
requirements_all.txt
with
13 additions
and
6 deletions
homeassistant/components/sensor/gitter.py
+
12
−
5
View file @
2d88f477
...
@@ -8,12 +8,12 @@ import logging
...
@@ -8,12 +8,12 @@ import logging
import
voluptuous
as
vol
import
voluptuous
as
vol
import
homeassistant.helpers.config_validation
as
cv
from
homeassistant.components.sensor
import
PLATFORM_SCHEMA
from
homeassistant.components.sensor
import
PLATFORM_SCHEMA
from
homeassistant.const
import
CONF_NAME
,
CONF_API_KEY
,
CONF_ROOM
from
homeassistant.const
import
CONF_API_KEY
,
CONF_NAME
,
CONF_ROOM
import
homeassistant.helpers.config_validation
as
cv
from
homeassistant.helpers.entity
import
Entity
from
homeassistant.helpers.entity
import
Entity
REQUIREMENTS
=
[
'
gitterpy==0.1.
6
'
]
REQUIREMENTS
=
[
'
gitterpy==0.1.
7
'
]
_LOGGER
=
logging
.
getLogger
(
__name__
)
_LOGGER
=
logging
.
getLogger
(
__name__
)
...
@@ -47,7 +47,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
...
@@ -47,7 +47,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
username
=
gitter
.
auth
.
get_my_id
[
'
name
'
]
username
=
gitter
.
auth
.
get_my_id
[
'
name
'
]
except
GitterTokenError
:
except
GitterTokenError
:
_LOGGER
.
error
(
"
Token is not valid
"
)
_LOGGER
.
error
(
"
Token is not valid
"
)
return
False
return
add_devices
([
GitterSensor
(
gitter
,
room
,
name
,
username
)],
True
)
add_devices
([
GitterSensor
(
gitter
,
room
,
name
,
username
)],
True
)
...
@@ -96,7 +96,14 @@ class GitterSensor(Entity):
...
@@ -96,7 +96,14 @@ class GitterSensor(Entity):
def
update
(
self
):
def
update
(
self
):
"""
Get the latest data and updates the state.
"""
"""
Get the latest data and updates the state.
"""
data
=
self
.
_data
.
user
.
unread_items
(
self
.
_room
)
from
gitterpy.errors
import
GitterRoomError
try
:
data
=
self
.
_data
.
user
.
unread_items
(
self
.
_room
)
except
GitterRoomError
as
error
:
_LOGGER
.
error
(
error
)
return
if
'
error
'
not
in
data
.
keys
():
if
'
error
'
not
in
data
.
keys
():
self
.
_mention
=
len
(
data
[
'
mention
'
])
self
.
_mention
=
len
(
data
[
'
mention
'
])
self
.
_state
=
len
(
data
[
'
chat
'
])
self
.
_state
=
len
(
data
[
'
chat
'
])
...
...
This diff is collapsed.
Click to expand it.
requirements_all.txt
+
1
−
1
View file @
2d88f477
...
@@ -344,7 +344,7 @@ gTTS-token==1.1.1
...
@@ -344,7 +344,7 @@ gTTS-token==1.1.1
gearbest_parser==1.0.5
gearbest_parser==1.0.5
# homeassistant.components.sensor.gitter
# homeassistant.components.sensor.gitter
gitterpy==0.1.
6
gitterpy==0.1.
7
# homeassistant.components.notify.gntp
# homeassistant.components.notify.gntp
gntp==1.0.3
gntp==1.0.3
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment