HOOK_entity_presave: field not accessible
Since Drupal 8 you need use OOP methods to get value from an entity field.
For example:

// If you have a field with machine name "field_final_note‎".
$values = $entity-&gt;get('field_final_note‎')-&gt;getValue();


Also, have a look for the type of the entity:

if ($entity-&gt;getEntityTypeId() == 'node' &amp;&amp; $entity-&gt;bundle() == 'node_type') {
 // Your code.
}


P.S. Well it is very helpful to know the next points

// An old entity state.
if (isset($entity-&gt;original)) {
  $old_entity = $entity-&gt;original;
  // Some code.
}    

// If the entity is new.
if ($entity-&gt;isNew()) {
  // Some code.
}