Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #53 from matthenning/master
Browse files Browse the repository at this point in the history
v1.2-beta
  • Loading branch information
matthenning committed Feb 6, 2017
2 parents d1f68ef + 79ff12d commit 3bfb1f2
Show file tree
Hide file tree
Showing 226 changed files with 9,486 additions and 921 deletions.
19 changes: 16 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ DB_PASSWORD=

CACHE_DRIVER=memcached
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
Expand All @@ -20,7 +25,15 @@ MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

TELEGRAM_TOKEN=
TELEGRAM_WEBHOOK_TOKEN=
TELEGRAM_BOT_TOKEN=
TELEGRAM_BOT_NAME=

DEFAULT_SOFT_STATE_DURATION_MINUTES=10
CACHE_API_TERRARIUM_SHOW_DURATION=30
CACHE_API_TERRARIUM_GRAPH_DURATION=3600
TERRARIUM_DEFAULT_HISTORY_MINUTES=720
PAGINATION_PER_PAGE=10

BROADCAST_DRIVER=pusher
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP_ID=
24 changes: 5 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,18 @@ The frontend was built using Google's material design guidelines and will give y

# Features

* Real-time dashboard using Vue and Pusher or another push service of your choice
* Temperature and humidity monitoring with notification support, e.g. via Telegram
* Automatic irrigation schedules
* Keep track of your animals' feeding schedules and weight
* Realtime dashboard using Vue and Pusher, or another push service of your choice
* Keep track of your animals' feeding schedules, weight and everything else
* Printable caresheets with all relevant data about your animals' health
* File management for photos and other files
* Responsive Material Design UI with automatic night theme to relieve eye strain
* RESTful API
* Responsive Material Design UI with automatic night theme

# Screenshots

Mobile view examples

![Dashboard](/ciliatus_demo03.jpg?raw=true)

Terrarium overview

![Terraria](/ciliatus_demo01.png?raw=true)


Simple configuration dialogs

![Configuration](/ciliatus_demo02.png?raw=true)

# Demo

**Be aware:** The demo version pulls it's data from the live version every hour. There will be no realtime dashboard updates
**Be aware:** The demo version pulls it's data from our live environment every hour. Real-time updates are not available in the demo environment.

[Demo](https://demo01.ciliatus.io)

Expand Down
27 changes: 27 additions & 0 deletions app/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ class Action extends CiliatusModel
*/
protected $dates = ['created_at', 'updated_at', 'last_start_at', 'last_end_at'];

/**
* @var array
*/
protected $fillable = [
'action_sequence_id', 'target_type', 'target_id', 'desired_state', 'duration_minutes', 'sequence_sort_id'
];

/**
* @return bool|null
*/
public function delete()
{
foreach ($this->running_actions as $ra) {
$ra->delete();
}

return parent::delete();
}

/**
* @return null
*/
Expand Down Expand Up @@ -70,6 +89,14 @@ public function sequence()
return $this->belongsTo('App\ActionSequence', 'action_sequence_id', 'id');
}

/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function running_actions()
{
return $this->hasMany('App\RunningAction');
}

/**
* @return mixed
*/
Expand Down
28 changes: 28 additions & 0 deletions app/ActionSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public function delete()
$ass->delete();
}

foreach ($this->triggers as $ast) {
$ast->delete();
}

parent::delete();
}

Expand All @@ -51,6 +55,22 @@ public function schedules()
return $this->hasMany('App\ActionSequenceSchedule')->orderBy('starts_at');
}

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function triggers()
{
return $this->hasMany('App\ActionSequenceTrigger')->with('logical_sensor')->orderBy('timeframe_start');
}

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function intentions()
{
return $this->hasMany('App\ActionSequenceIntention')->orderBy('timeframe_start');
}

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
Expand All @@ -59,6 +79,14 @@ public function terrarium()
return $this->belongsTo('App\Terrarium');
}

/**
* @return bool
*/
public static function stopped()
{
return !is_null(Property::where('type', 'SystemProperty')->where('name', 'stop_all_action_sequences')->get()->first());
}

/**
* @return string
*/
Expand Down
Loading

0 comments on commit 3bfb1f2

Please sign in to comment.