Class: Hikvision::System
- Defined in:
- lib/hikvision/system.rb,
lib/hikvision/system/face.rb,
lib/hikvision/system/time.rb,
lib/hikvision/system/person.rb,
lib/hikvision/system/reboot.rb,
lib/hikvision/system/status.rb,
lib/hikvision/system/time/ntp.rb,
lib/hikvision/system/acs_event.rb,
lib/hikvision/system/device_info.rb,
lib/hikvision/system/diagnosed_data.rb
Defined Under Namespace
Classes: Time
Instance Attribute Summary collapse
-
#network ⇒ Object
readonly
Returns the value of attribute network.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #add_face(options = { cache: false }) ⇒ Object
- #add_person(options = { cache: false }) ⇒ Object
- #delete_person(options = { cache: false }) ⇒ Object
- #diagnosed_data(options = { cache: false }) ⇒ Object
- #get_event(options = { cache: false }) ⇒ Object
-
#get_event_photo(url, file_path, options = { cache: false }) ⇒ Object
保存刷脸照片.
-
#initialize(isapi) ⇒ System
constructor
A new instance of System.
- #reboot ⇒ Object
Constructor Details
Instance Attribute Details
#network ⇒ Object (readonly)
Returns the value of attribute network.
3 4 5 |
# File 'lib/hikvision/system.rb', line 3 def network @network end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
3 4 5 |
# File 'lib/hikvision/system.rb', line 3 def time @time end |
Instance Method Details
#add_face(options = { cache: false }) ⇒ Object
3 4 5 |
# File 'lib/hikvision/system/face.rb', line 3 def add_face( = { cache: false }) @isapi.post('/ISAPI/Intelligent/FDLib/FaceDataRecord?format=json', ).response.body end |
#add_person(options = { cache: false }) ⇒ Object
3 4 5 |
# File 'lib/hikvision/system/person.rb', line 3 def add_person( = { cache: false }) @isapi.post('/ISAPI/AccessControl/UserInfo/Record?format=json', ).response.body end |
#delete_person(options = { cache: false }) ⇒ Object
7 8 9 |
# File 'lib/hikvision/system/person.rb', line 7 def delete_person( = { cache: false }) @isapi.put('/ISAPI/AccessControl/UserInfo/Delete?format=json', ).response.body end |
#diagnosed_data(options = { cache: false }) ⇒ Object
3 4 5 |
# File 'lib/hikvision/system/diagnosed_data.rb', line 3 def diagnosed_data( = { cache: false }) @isapi.get('/ISAPI/System/diagnosedData', ).response.body end |
#get_event(options = { cache: false }) ⇒ Object
3 4 5 |
# File 'lib/hikvision/system/acs_event.rb', line 3 def get_event( = { cache: false }) @isapi.post('/ISAPI/AccessControl/AcsEvent?format=json', ).response.body end |
#get_event_photo(url, file_path, options = { cache: false }) ⇒ Object
保存刷脸照片
8 9 10 11 12 13 |
# File 'lib/hikvision/system/acs_event.rb', line 8 def get_event_photo(url, file_path, = { cache: false }) file_content = @isapi.get_original(url, ).response.body File.open(file_path, 'wb') do |f| f.write(file_content) end end |
#reboot ⇒ Object
3 4 5 |
# File 'lib/hikvision/system/reboot.rb', line 3 def reboot @isapi.put('/ISAPI/System/reboot') end |