e5efc2e430b9f1009a8196a7de3eb198379cc852,homeassistant/components/sensor/time_date.py,TimeDateSensor,update,#TimeDateSensor#,72
Before Change
// Calculate the beat (Swatch Internet Time) time without date.
hours, minutes, seconds = time_date.strftime("%H:%M:%S").split(":")
beat = ((int(seconds) + (int(minutes) * 60) + ((int(hours) + 1) *
3600)) / 86.4)
if self.type == "time":
self._state = time
elif self.type == "date":
After Change
date = dt_util.as_local(time_date).date().isoformat()
// Calculate Swatch Internet Time.
time_bmt = time_date + timedelta(hours=1)
delta = timedelta(hours=time_bmt.hour,
minutes=time_bmt.minute,
seconds=time_bmt.second,
microseconds=time_bmt.microsecond)
beat = int((delta.seconds + delta.microseconds / 1000000.0) / 86.4)
if self.type == "time":
self._state = time
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: home-assistant/home-assistant
Commit Name: e5efc2e430b9f1009a8196a7de3eb198379cc852
Time: 2016-05-31
Author: themactep@gmail.com
File Name: homeassistant/components/sensor/time_date.py
Class Name: TimeDateSensor
Method Name: update
Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: tests/components/test_recorder.py
Class Name: TestRecorder
Method Name: _add_test_states
Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: tests/components/test_recorder.py
Class Name: TestRecorder
Method Name: _add_test_events