-
-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Add "status" to Sonarr sensor #9204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
7cea789
e33c18a
0af8382
37507ac
484193a
fb9392a
59847bb
2cdf2d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -549,6 +549,25 @@ def json(self): | |
| "totalSpace": 499738734592 | ||
| } | ||
| ], 200) | ||
| elif 'api/system/status' in url: | ||
| return MockResponse({ | ||
| "version": "2.0.0.1121", | ||
| "buildTime": "2014-02-08T20:49:36.5560392Z", | ||
| "isDebug": false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'false' |
||
| "isProduction": true, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'true' |
||
| "isAdmin": true, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'true' |
||
| "isUserInteractive": false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'false' |
||
| "startupPath": "C:\\ProgramData\\NzbDrone\\bin", | ||
| "appData": "C:\\ProgramData\\NzbDrone", | ||
| "osVersion": "6.2.9200.0", | ||
| "isMono": false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'false' |
||
| "isLinux": false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'false' |
||
| "isWindows": true, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'true' |
||
| "branch": "develop", | ||
| "authentication": false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'false' |
||
| "startOfWeek": 0, | ||
| "urlBase": "" | ||
| }, 200) | ||
| else: | ||
| return MockResponse({ | ||
| "error": "Unauthorized" | ||
|
|
@@ -794,6 +813,31 @@ def test_upcoming_today(self, req_mock): | |
| device.device_state_attributes["Bob's Burgers"] | ||
| ) | ||
|
|
||
| @unittest.mock.patch('requests.get', side_effect=mocked_requests_get) | ||
| def test_system_status(self, req_mock): | ||
| """Test getting system status""" | ||
| config = { | ||
| 'platform': 'sonarr', | ||
| 'api_key': 'foo', | ||
| 'days': '2', | ||
| 'unit': 'GB', | ||
| "include_paths": [ | ||
| '/data' | ||
| ], | ||
| 'monitored_conditions': [ | ||
| 'status' | ||
| ] | ||
| } | ||
| radarr.setup_platform(self.hass, config, self.add_devices, None) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'radarr' |
||
| for device in self.DEVICES: | ||
| device.update() | ||
| self.assertEqual('2.0.0.1121', device.state) | ||
| self.assertEqual('mdi:information', device.icon) | ||
| self.assertEqual('Sonarr Status', device.name) | ||
| self.assertEqual( | ||
| '6.2.9200.0', | ||
| device.device_state_attributes['osVersion']) | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blank line contains whitespace |
||
| @pytest.mark.skip | ||
| @unittest.mock.patch('requests.get', side_effect=mocked_requests_get) | ||
| def test_ssl(self, req_mock): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line unaligned for hanging indent